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

> يبحث في live garbage-collected tables أو functions التي تطابق filters المقدمة. يجب أن يكون filterType هو "table" أو "function". يجب أن تكون options من نوع table.

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

  ## الوسائط

  <ParamField path={"filterType"} type={"string"} required>
    نوع GC object للبحث. يتم تحويل القيمة إلى lowercase ويجب أن تكون "table" أو "function".
  </ParamField>

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

  <ParamField path={"returnOne"} type={"boolean"}>
    Optional optional boolean handling flag. عند true، ترجع أول matching object أو nil بدلا من array table.
  </ParamField>

  ## القيم الراجعة

  <ResponseField name={"result"} type={"table | function | nil"}>
    عندما يكون returnOne false أو omitted، array table of matches. عندما يكون returnOne true، أول matching table/function object أو nil.
  </ResponseField>

  ## مثال

  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>
