When you want to delete an entity from Fiware Orion, you need to provide its ServicePath, Then how do you delete an item if you don't know its service path ?
Other question more or less related (How to retreive some entity's service path)
When you want to delete an entity from Fiware Orion, you need to provide its ServicePath, Then how do you delete an item if you don't know its service path ?
Other question more or less related (How to retreive some entity's service path)
Currently, Orion API doesn't allow such operation directly, but as workaround you can know the service path to which an entity belongs with a query on the MongoDB database.
Let's assume the entity ID is Room1
, entity the type is Room
and you are using the default database name (i.e. orion
), you can run the following command (in the same host where the MongoDB database runs).
echo 'db.entities.find({"_id.id": "Room1", "_id.type": "Room"}, {_id: 1})' | mongo orion --quiet
You will get a result like this one:
{ "_id" : { "id" : "Room1", "type" : "Room", "servicePath" : "/path" } }
The servicePath
field specifies the entity service path (/path
in the above example).