FQL v4 will be decommissioned on June 30, 2025. Ensure that you complete your migration from FQL v4 to FQL v10 by that date. Fauna accounts created after August 21, 2024 must use FQL v10. These accounts will not be able to run FQL v4 queries or access the v4 Dashboard. For more details, see the v4 EOL announcement and migration guide. Contact support@fauna.com with any questions. |
Filter
This reference topic applies to FQL v4. Go to this page for the latest FQL v10 reference topics. |
Filter( arrayOrSet, lambda )
filter_( lambda, array_or_set )
Filter( arrayOrSet, lambda )
Filter( arrayOrSet, lambda )
Filter( arrayOrSet, lambda )
Filter( arrayOrSet, lambda )
Description
The Filter
function applies the Lambda
function to each
member of arrayOrSet
, which is an Array, Page, or
Set. The return value matches the arrayOrSet
type, and contains
only those elements for which the lambda
function returns true
.
Providing a lambda
function which does not return a Boolean
results in an "invalid argument" error. If a Page is passed, its
decorated fields are preserved in the result.
The run time of For query timeout errors, you may specify a larger query timeout via the driver that you are using. |
Parameters
Parameter | Type | Definition and Requirements |
---|---|---|
|
Array, Page, or Set |
The group of items over which the |
|
The anonymous function to be executed, which must return a boolean. |
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!