Lets say we have an entity with attributes A,B,C,D. Can we update only some of them, for example only B and D, or we have to update all of them, or just only one? And if it's possible to update some of them, how the target url must be constructed for the request to work?
1
votes
1 Answers
1
votes
You can update only a subset of attributes if you want. For instance:
PATCH /v2/entities/E1/attrs
{
"B": {
"value": "foo",
"type": "Text"
},
"D": {
"value": "bar",
"type": "Text"
}
}
which updates B and D but leave A and C untouched. You can use POST
instead of PATCH
: the former does update or create if the attribute doesn't exist in the entity, the later is for strict update (if the attribute to update doesn't exist, you will get an error response).
This and more detail can be found in the NGSIv2 specification document.