Search code examples
fiwarefiware-orion

Query numerical string values in Orion Context Broker


I am failing to query a string property set with a numerical value. Example:

//entity in orion
{
    "id": "Test.2",
    "type": "Test",
    "nombre": "1"
}

//query
http://<some-ip>:<some-port>/v2/entities?type=Test&q=nombre==1

//response
[]

I changed the attribute to store a number and the query works well then. Anyway, it should be possible to query numerical string values, shouldn't it?

EDIT

I found this problem will be issued in version 0.26


Solution

  • As described in the issue cited by @nespapu, NGSIv2 will allow that posibility in the following way:

    //query
    http://<some-ip>:<some-port>/v2/entities?type=Test&q=nombre=='1'
    

    However, current Orion version at the time of writting this (0.24.0) doesn't implemented yet such functionality.

    EDIT: implemented since Orion 1.3.0