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

> Recherche les tables ou functions live garbage-collected qui correspondent aux filters fournis. filterType doit être "table" ou "function". options doit être une table.

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

  ## Arguments

  <ParamField path={"filterType"} type={"string"} required>
    GC object type a rechercher. La valeur est convertie en lowercase et doit etre "table" ou "function".
  </ParamField>

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

  <ParamField path={"returnOne"} type={"boolean"}>
    Optional optional boolean handling flag. Quand true, retourne le premier matching object ou nil au lieu d une array table.
  </ParamField>

  ## Retours

  <ResponseField name={"result"} type={"table | function | nil"}>
    Quand returnOne est false ou omis, une array table of matches. Quand returnOne est true, le premier matching table/function object ou nil.
  </ResponseField>

  ## Exemple

  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>
