Skip to main content
Version: 1.x

Object functions

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

FunctionDescription
object::entries()Since 1.1.0Transforms an object into an array with arrays of key-value combinations.
object::from_entries()Since 1.1.0Transforms an array with arrays of key-value combinations into an object.
object::keys()Since 1.1.0Returns an array with all the keys of an object.
object::len()Since 1.1.0Returns the amount of key-value pairs an object holds.
object::values()Since 1.1.0Returns 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 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 Since 1.1.0

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 Since 1.1.0

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 Since 1.1.0

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 Since 1.1.0

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 ]