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

> Busca tables o functions live garbage-collected que coincidan con los filters dados. filterType debe ser "table" o "function". options debe ser una 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 que se busca. El valor se convierte a lowercase y debe ser "table" o "function".
  </ParamField>

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

  <ParamField path={"returnOne"} type={"boolean"}>
    Optional optional boolean handling flag. Cuando es true, devuelve el primer matching object o nil en lugar de una array table.
  </ParamField>

  ## Retornos

  <ResponseField name={"result"} type={"table | function | nil"}>
    Cuando returnOne es false o se omite, una array table of matches. Cuando returnOne es true, el primer matching table/function object o nil.
  </ResponseField>

  ## Ejemplo

  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>
