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. |
ToObject
This reference topic applies to FQL v4. Go to this page for the latest FQL v10 reference topics. |
ToObject( array )
to_object( array )
ToObject( array )
ToObject( array )
ToObject( array )
Description
The ToObject
function converts an Array of arrays, containing
field names and values, into an Object, if possible.
If array
cannot be converted into an object, an "invalid argument"
error is returned.
Parameters
Parameter | Type | Definition and Requirements |
---|---|---|
|
Array |
An Array of Arrays containing field names and values. |
Examples
The following query converts an array into an object:
{ name: 'Dennis', age: 37 }
{'name': 'Dennis', 'age': 37}
map[age:37 name:Dennis]
ObjectV(name: StringV(Dennis),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!