-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Push elements in attributes which value is a vector #744
Comments
Not only pushing a single element, but a list of them. |
My vision includes the insertion of Observer who will trigger the function on the basis of parameters. The script with functional examples is here https://github.com/inter-coder/Orion-Web-Proxy-for-Cross-Domain |
This needs to be re-considered under the light of NGSIv2 API. |
Out of the scope of NGSIv2, althouth it is a good idea that could (potentially) be included in a later version of the API (v2.1) in a backward compatible way. |
Hi Fermin, Wanted to check if the above feature to push new array elements into attributes, without overwriting the existing values, has been implemented yet in latest NGSI v2 APIs? We have a similar requirement, where we want to keep adding new elements to an array without overwriting the previous values. But seems the current API does not allow this feature. Can you please help us on this. Thanks! |
Orion 3.3.0 supports the usage of update operators (doc here: https://fiware-orion.readthedocs.io/en/master/user/update_operators/index.html) as extension to "clasical" NGSIv2. The
With regards to:
Taking advantage of
Could you test them and tell us how it goes, please? Thanks! |
Hi Fermin, Thanks for your quick reply. We were able to successfully test the above mentioned update operators, with few observations:
In our case, we wouldn't know if attribute already exists or not when performing Batch operation, so this will be an overhead to first make sure Array attribute exists and only then use $push appropriately. Is there a solution/workaround to make it work the first time itself?
|
Thanks for the feedback! Some comments:
|
I've done the test myself and you are right: there is some problem with fiware/orion:latest image. I have opened an issue here: #4028 In the meanwhile, you can use telefonicaiot/fiware-orion:latest, that works correctly |
I have tested
but it is not working as expected, as the CB replacing logic in dbEncode() is changing I'll try to fix. |
PR #4029 |
At the present moment (Orion 0.18.1), the only way of 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.
The text was updated successfully, but these errors were encountered: