Object functions
These functions can be used when working with, and manipulating data objects.
Function | Description |
---|---|
object::entries() | Transforms an object into an array with arrays of key-value combinations. |
object::from_entries() | Transforms an array with arrays of key-value combinations into an object. |
object::keys() | Returns an array with all the keys of an object. |
object::len() | Returns the amount of key-value pairs an object holds. |
object::values() | Returns an array with all the values of an object. |
object::entries
Since 1.1.0
The object::entries
function transforms an object into an array with arrays of key-value combinations.
API DEFINITIONobject::entries(object) -> array
The following example shows this function, and its output, when used in a RETURN
statement:
RETURN object::entries({
a: 1,
b: true
});
[
[ "a", 1 ],
[ "b", true ],
]
object::from_entries
Since 1.1.0
The object::from_entries
function transforms an array with arrays of key-value combinations into an object.
API DEFINITIONobject::from_entries(array) -> object
The following example shows this function, and its output, when used in a RETURN
statement:
RETURN object::from_entries([
[ "a", 1 ],
[ "b", true ],
]);
{
a: 1,
b: true
}
object::keys
Since 1.1.0
The object::keys
function returns an array with all the keys of an object.
API DEFINITIONobject::keys(object) -> array
The following example shows this function, and its output, when used in a RETURN
statement:
RETURN object::keys({
a: 1,
b: true
});
[ "a", "b" ]
object::len
Since 1.1.0
The object::len
function returns the amount of key-value pairs an object holds.
API DEFINITIONobject::len(object) -> number
The following example shows this function, and its output, when used in a RETURN
statement:
RETURN object::len({
a: 1,
b: true
});
2
object::values
Since 1.1.0
The object::values
function returns an array with all the values of an object.
API DEFINITIONobject::values(object) -> array
The following example shows this function, and its output, when used in a RETURN
statement:
RETURN object::values({
a: 1,
b: true
});
[ 1, true ]