Table filter options
Table filters define what types of Luau tables should be returned when using filtergc
with "table"
as the filter type.
Each key in the filter table specifies a condition the table must meet in order to be returned. You can use one or multiple fields together to narrow your results.
Available Options
Key | Type | Description | Default |
---|---|---|---|
Keys |
{ any }? |
If provided, also includes tables that contain all the specified keys. | nil |
Values |
{ any }? |
If provided, only includes tables that contain all the specified values. | nil |
KeyValuePairs |
{ [any]: any }? |
If provided, only includes tables that contain all key-value pairs in this table. | nil |
Metatable |
table? |
If provided, only includes tables whose metatable matches the given one. | nil |
Notes
- These filters work based on narrowing - the more information you provide in the filters, the more accurate the result.
- If
Metatable
is used, a raw metatable comparison is performed.
Examples
False negatives may occur
Executing these examples multiple times in a short period of time may result in false negatives.
Matching by Keys
Matching a table by key | |
---|---|
Matching by KeyValuePairs
Matching a table by key-value pairs | |
---|---|