> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# filtergc

> Sucht live garbage-collected tables oder functions, die zu den angegebenen filters passen. filterType muss "table" oder "function" sein. options muss eine table sein.

<div className="real-function-page">
  ```lua theme={null}
  filtergc(filterType: string, options: table, returnOne?: boolean): table | function | nil
  ```

  ## Argumente

  <ParamField path={"filterType"} type={"string"} required>
    GC object type für die Suche. Der Wert wird in lowercase umgewandelt und muss "table" oder "function" sein.
  </ParamField>

  <ParamField path={"options"} type={"table"} required>
    Filter table. function searches lesen Name, Hash, StartLine, IgnoreExecutor, IgnoreSyn, Environment, Constants und Upvalues. table searches lesen Metatable, Keys, Values und KeyValuePairs.
  </ParamField>

  <ParamField path={"returnOne"} type={"boolean"}>
    Optionales optional boolean handling flag. Wenn true, wird das erste matching object oder nil statt einer array table zurückgegeben.
  </ParamField>

  ## Rückgaben

  <ResponseField name={"result"} type={"table | function | nil"}>
    Wenn returnOne false ist oder fehlt, eine array table of matches. Wenn returnOne true ist, das erste matching table/function object oder nil.
  </ResponseField>

  ## Beispiel

  Find GC tables by key filters without relying on result order.

  ```lua theme={null}
  local marker = {
      RealDocsMarker = true,
  }

  local matches = filtergc("table", {
      Keys = { "RealDocsMarker" },
  })

  for _, value in ipairs(matches) do
      if value == marker then
          print("found marker")
          break
      end
  end

  local first = filtergc("table", {
      Keys = { "RealDocsMarker" },
  }, true)

  print(first ~= nil)
  ```
</div>
