1
votes

I made entity

{ "contextElements": [ { "type": "T1", "isPattern": "false", "id": "E1", "attributes": [ { "name": "A", "type": "T", "value": [ "22" , { "x": [ "x1", "x2"], "y": "3" }, [ "z1", "z2" ] ] }, { "name": "B", "type": "T", "value": { "x": { "x1": "a", "x2": "b" }, "y": [ "y1", "y2" ] } } ] } ], "updateAction": "APPEND" }

Now I want to add values in an array, a string ("NEW VALUE") and a json object ({"NEW":"OBJECT"})

{ "contextElements": [ { "type": "T1", "isPattern": "false", "id": "E1", "attributes": [ { "name": "A", "type": "T", "value": [ "22" , { "x": [ "x1", "x2"], "y": "3" }, [ "z1", "z2" ] , "NEW VALUE", {"NEW":"OBJECT"} ] } ] } ], "updateAction": "UPDATE" }

Is possible to add new values as you would do this in array.push()?

Save the previous values and add only new ones after.

1

1 Answers

1
votes

At the present moment (Orion 0.18.1), the only way of adding adding an element to an attribute which value is a vector is to update such attribute with a new vector containing the new element.

However, I think that pushing elements in attributes which value is a vector whitout needing to update the whole vector is an interesting feature to take into account, so we have created an issue about it and eventually it may be implemented.