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

> Procura tables ou functions live garbage-collected que correspondem aos filters fornecidos. filterType deve ser "table" ou "function". options deve ser uma table.

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

  ## Argumentos

  <ParamField path={"filterType"} type={"string"} required>
    GC object type a procurar. O valor e convertido para lowercase e precisa ser "table" ou "function".
  </ParamField>

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

  <ParamField path={"returnOne"} type={"boolean"}>
    Optional optional boolean handling flag. Quando true, retorna o primeiro matching object ou nil em vez de uma array table.
  </ParamField>

  ## Retornos

  <ResponseField name={"result"} type={"table | function | nil"}>
    Quando returnOne e false ou omitted, uma array table of matches. Quando returnOne e true, o primeiro matching table/function object ou nil.
  </ResponseField>

  ## Exemplo

  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>
