Skip to main content
Version: Nightly

Object functions

Object functions

These functions can be used when working with, and manipulating data objects.

FunctionDescription
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

The object::entries function transforms an object into an array with arrays of key-value combinations.

API DEFINITION
object::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

The object::from_entries function transforms an array with arrays of key-value combinations into an object.

API DEFINITION
object::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

The object::keys function returns an array with all the keys of an object.

API DEFINITION
object::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

The object::len function returns the amount of key-value pairs an object holds.

API DEFINITION
object::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

The object::values function returns an array with all the values of an object.

API DEFINITION
object::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 ]