SelectAll
SelectAll( path, from )
SelectAll( path, from )
SelectAll( path, from )
SelectAll( path, from )
select_all( 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.
|
Examples
The following query extracts all of the name
fields from the provided
array, by using a string-based path:
Arr(StringV(Jane), StringV(John), StringV(Thomas))
[Jane John Thomas]
["Jane", "John", "Thomas"]
[ 'Jane', 'John', '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:
Arr(StringV(Jane), StringV(John), StringV(Thomas))
[Jane John Thomas]
["Jane", "John", "Thomas"]
[ 'Jane', 'John', '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!