Details
-
Task
-
Resolution: Fixed
-
Major
-
6.5.1, Cheshire-Cat, Neo
Description
Currently the function object_concat takes an arbitrary but fixed number of JSON objects as parameters and aggregates them to one JSON object that contains all key-value pairs of the input JSON objects.
To support more dynamic uses of the function, we should also support passing an array of objects as a (single) parameter. This allows us to
- concatenate an arbitrary number of JSON objects into a single object and
- the sequence of input objects can be computed at runtime (e.g. by a subquery).
This allows us to dynamically create new objects. E.g.
SELECT VALUE OBJECT_CONCAT([{"name1":"val1"},{"name2":"val2"}])
|
would yield
[
|
{
|
"name1": "val1",
|
"name2": "val2"
|
}
|
]
|
just like
SELECT VALUE OBJECT o.name: o.val FOR o IN
|
[{"name":"name1","val":"val1"},{"name":"name2","val":"val2"}]
|
END
|
which uses the more general OBJECT constructor functionality that is available in the Query Service.