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. |
SelectAll
This reference topic applies to FQL v4. Go to this page for the latest FQL v10 reference topics. |
SelectAll( path, from )
select_all( path, from )
SelectAll( path, from )
SelectAll( path, from )
SelectAll( path, from )
SelectAll( path, from )
Description
The SelectAll
function extracts one or more values from a
document, Object, or
Array. It is very useful when extracting multiple values from an
Array. It extracts all of the values specified by the path
parameter
out of the from
parameter and returns the values as an Array. If the path
does not exist an empty array is returned.
This function is not comparable to SQL’s SELECT command.
If you are looking to fetch documents from a collection, see
the Paginate function.
|
Parameter
Parameter | Type | Definition and Requirements |
---|---|---|
|
String |
The path to the field in the document to extract |
|
Object or Array |
The object or array containing the data to be extracted. |
Examples
The following query extracts all of the name
fields from the provided
array, by using a string-based path:
[ 'Jane', 'John', 'Thomas' ]
['Jane', 'John', 'Thomas']
[Jane John Thomas]
Arr(StringV(Jane), StringV(John), StringV(Thomas))
["Jane", "John", "Thomas"]
[ 'Jane', 'John', 'Thomas' ]
The following query extracts all of the first names from the name
fields, by using a path that includes a numeric index:
[ 'Jane', 'John', 'Thomas' ]
['Jane', 'John', 'Thomas']
[Jane John Thomas]
Arr(StringV(Jane), StringV(John), StringV(Thomas))
["Jane", "John", "Thomas"]
[ 'Jane', 'John', 'Thomas' ]
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!