1
votes

I'd like to update the entity type, but couldn't find the request to do so. It may not be possible, but I don't understand the reason.

I tried updating the entity type with IoTA. The IoTA was updated but Orion was not.

Then I found this answer: FIWARE Orion: change entity type

I dont understand the funcionality of entityType. Why is inmutable?

Thanks.

1

1 Answers

0
votes

The combination of entity id and entity type compose the identification of an entity. They are like the "primary key" of the entity.

The identification of the entity is immutable. Thus, neither id nor type can be changed. There is no operation in the NGSIv2 API to do so.

A possible workaround is to recreate the entity with a different type. Something like this (pseudo-code):

oldEntity = GET /v2/entities/<id>?type=<oldType>
newEntity = oldEntity
newEntity.type = newType
POST /v2/entities (using newEntity as payload)