venge
venge

Reputation: 187

Deleting entity in a Fiware-ServicePath, deletes entities with the same id in subpaths

Should this be normal? I've got a Fiware-ServicePath:

/user/home/room

I've set an entity with an id "table1" under path /user/home and under /user/home/room. When trying to delete "table1" id

Fiware-ServicePath: /user
{
  "contextElements": [
   {
      "type": "table",
      "isPattern": "false",
      "id": "table1"
    }
  ],
  "updateAction": "DELETE"
}

under /user, is it normal for the rest of the entities with id "table1" to get deleted (under scopes /user/home and /user/home/room)?

Also, is there any chance to get the path of an already existing entity, if for example someone forgot it? I am able to receive entities with .* under default path /#, but if an entity is just ONE path under the main, I can't delete it.

Upvotes: 1

Views: 120

Answers (1)

LeandroGuillen
LeandroGuillen

Reputation: 518

A "scope" works in an inclusive way. This means that when you perform a search or any kind of update, including delete operations, in a specific path you are actually targeting all entities in that path and all paths hanging from it.

So you were actually deleting both tables.

For the second part, there is no discovery of service paths. You can know the path of a given entity by looking at the header, though.

EDIT

This is actually a behavior that is not what was planned to happen. There was a bug report made at the project's github. I'm referring to the deletion of entities in different service paths. Thanks for the input!!

Upvotes: 1

Related Questions