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

> Tìm live garbage-collected tables hoặc functions khớp với filters đã cung cấp. filterType phải là "table" hoặc "function". options phải là table.

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

  ## Đối số

  <ParamField path={"filterType"} type={"string"} required>
    GC object type can tim. Gia tri duoc chuyen thanh lowercase va phai la "table" hoac "function".
  </ParamField>

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

  <ParamField path={"returnOne"} type={"boolean"}>
    Optional optional boolean handling flag. Khi true, tra ve matching object dau tien hoac nil thay vi array table.
  </ParamField>

  ## Giá trị trả về

  <ResponseField name={"result"} type={"table | function | nil"}>
    Khi returnOne la false hoac omitted, array table of matches. Khi returnOne la true, matching table/function object dau tien hoac nil.
  </ResponseField>

  ## Ví dụ

  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>
