> ## 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

> Szuka live garbage-collected tables albo functions pasujących do podanych filters. filterType musi być "table" albo "function". options musi być table.

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

  ## Argumenty

  <ParamField path={"filterType"} type={"string"} required>
    Szukany GC object type. Wartosc jest konwertowana do lowercase i musi byc "table" albo "function".
  </ParamField>

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

  <ParamField path={"returnOne"} type={"boolean"}>
    Optional optional boolean handling flag. Gdy true, zwraca pierwszy matching object albo nil zamiast array table.
  </ParamField>

  ## Zwroty

  <ResponseField name={"result"} type={"table | function | nil"}>
    Gdy returnOne jest false albo omitted, array table of matches. Gdy returnOne jest true, pierwszy matching table/function object albo nil.
  </ResponseField>

  ## Przykład

  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>
