Object Functions
NOTE
Verification Status: Tested and Verified against rekuiper engine with live telemetry stream load on 2026-10-01 17:54:00 UTC.
Scorecard: 10 Verified, 0 Unsupported, 0 Broken:
- Verified (10):
keys,values,object,zip,items,object_construct,object_concat,erase,object_pick,obj_to_kvpair_array.
Object functions construct, manipulate, and extract data from JSON objects and map structures.
KEYS
keys(obj)Returns an array that contains all keys of the object.
Example:
keys({"a":1, "b":2})Result:
["a","b"]VALUES
values(obj)Returns an array that contains all values of the object.
Example:
values({"a":1, "b":2})Result:
[1,2]OBJECT
object(keys, values)Constructs an object from an array of string keys and an array of corresponding values. Both arrays must have the same length.
Example:
object(["a","b"],[1,2])Result:
{"a":1, "b":2}ZIP
zip(entries)Constructs an object from an array of two-element entry arrays. In each entry array, the first element is a string key and the second element is the value.
Example:
zip([["a",1],["b",2]])Result:
{"a":1, "b":2}ITEMS
items(obj)Returns an array of key-value pairs from the object. Each item in the returned array is a two-element array where the first element is the key and the second element is the value.
Example:
items({"a":1, "b":2})Result:
[["a",1],["b",2]]OBJECT_CONSTRUCT
object_construct(key1, col1, key2, col2, ...)Returns an object constructed from key-value argument pairs. The function requires an even number of arguments. Keys must be strings. If a value is null, the function omits that key-value pair from the output object.
Example:
object_construct("a", 1, "b", 2)Result:
{"a":1, "b":2}OBJECT_CONCAT
object_concat(obj1, obj2, ...)Merges multiple input objects into a single new object. The function requires at least two input objects. When duplicate keys exist across objects, the value from the last object in the argument list overwrites earlier values.
Example:
object_concat({"a": 1}, {"b": 2}, {"b": 3})Result:
{"a":1, "b":3}ERASE
erase(obj, k)Removes specified keys from an object. If k is a string, the function removes that single key. If k is an array of strings, the function removes all matching keys.
Example:
erase({"baz": [1, 2, 3], "bar": 'hello world',"foo":'emq'}, 'foo')Result:
{"baz": [1, 2, 3], "bar": 'hello world'}OBJECT_PICK
object_pick(obj, k)Extracts only the specified keys from an object. If k is a string, the function retains only that key. If k is an array of strings, the function retains all matching keys.
Example:
object_pick({"baz": [1, 2, 3], "bar": 'hello world',"foo":'emq'}, 'foo')Result:
{"foo":'emq'}OBJ_TO_KVPAIR_ARRAY
obj_to_kvpair_array(obj)Converts an object into an array of key-value objects.
Example:
obj_to_kvpair_array({"key1":1, "key2":2})Result:
[{"key":"key1", "value":1},{"key":"key2", "value":2}]