Aeronbroker / Aeron

Aeron is an Internet-of-Things middleware based on the OMA NGSI 9/10 standard.
Other
23 stars 9 forks source link

QueryContext() duplicates attributes for entities with more that 1 attribute #21

Open smirnp opened 5 years ago

smirnp commented 5 years ago

Hi!

I'm using the 'docker run -t -p 8065:8065 -p 8060:8060 -p 5984:5984 fiware/iotbroker:standalone-dev -p iotbroker_historicalagent="enabled"' as described here

I'm adding the following context element:

{
   "attributes":[
      {
         "metadata":[
            {
               "name":"units",
               "value":"dB",
               "type":"units"
            }
         ],
         "contextValue":"110691535297671",
         "name":"noiseLevel",
         "type":"float"
      },
      {
         "metadata":[
            {
               "name":"units",
               "value":"volt",
               "type":"units"
            }
         ],
         "contextValue":"110691535787180",
         "name":"batteryLevel",
         "type":"float"
      }
   ],
   "entityId":{
      "isPattern":false,
      "id":"noiseSensor",
      "type":"NoiseSensor"
   },
   "domainMetadata":[

   ]
}

And then performing the following POST query to the http://localhost:8060/ngsi10/queryContext:

{
  "entities": [
    {
      "id":"noiseSensor",
      "isPattern": true
    }
  ]
}

The result I get - the contextElement with 2, 3, 5, 7 .... attributes - depends on the number of queryContext requests I've already done.

Thanks for help!