FQL v4 will be decommissioned on June 30, 2025. Ensure that you complete your migration from FQL v4 to FQL v10 by that date. For more details, review the migration guide. Contact support@fauna.com with any questions. |
ToArray
This reference topic applies to FQL v4. Go to this page for the latest FQL v10 reference topics. |
ToArray( object )
to_array( object )
ToArray( object )
ToArray( object )
ToArray( object )
Description
The ToArray
function converts an Object to an Array,
if possible.
If conversion cannot be completed, for any reason, an "invalid argument" error is returned.
Parameters
Parameter | Type | Definition and Requirements |
---|---|---|
|
Object |
The Object to convert to an Array. |
Examples
The following query uses ToArray
to convert an object into an array:
[ [ 'name', 'Dennis' ], [ 'age', 37 ] ]
[['name', 'Dennis'], ['age', 37]]
[[age 37] [name Dennis]]
Arr(Arr(StringV(name), StringV(Dennis)), Arr(StringV(age), LongV(37)))
[ [ 'name', 'Dennis' ], [ 'age', 37 ] ]
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!