ToObject
Not available in this language yet.
Not available in this language yet.
ToObject( array )
ToObject( array )
Not available in this language yet.
ToObject( array )
Parameters
Argument | Type | Definition and Requirements |
---|---|---|
|
An array of arrays containing field names and values. |
Examples
The following query converts an array into an object:
Not available in this language yet.
Not available in this language yet.
System.out.println(
client.query(
ToObject(
Arr(
Arr(Value("name"), Value("Dennis")),
Arr(Value("age"), Value(37))
)
)
).get());
{name: "Dennis", age: 37}
client.query(
q.ToObject([['name', 'Dennis'], ['age', 37]])
)
.then((ret) => console.log(ret))
{ name: 'Dennis', age: 37 }
Not available in this language yet.
println(Await.result(
client.query(
ToObject(
Arr(
Arr("name", "Dennis"),
Arr("age", 37)
)
)
),
5.seconds
))
{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!