orchestracities / ngsi-timeseries-api

QuantumLeap: a FIWARE Generic Enabler to support the usage of NGSIv2 (and NGSI-LD experimentally) data in time-series databases
https://quantumleap.rtfd.io/
MIT License
38 stars 49 forks source link

time filtering bug? #642

Closed chicco785 closed 2 years ago

chicco785 commented 2 years ago

Describe the bug https://stackoverflow.com/questions/67932711/fiware-quantum-leap-date-query

pooja1pathak commented 2 years ago

Hi @chicco785 @c0c0n3 , I have tried to reproduce this issue. In my investigation I found that the API used by the user

curl -X GET "http://localhost:8668/v2/entities/urn:ngsi-ld:Pmr_obs:001/attrs/slotStatus?dateFrom=2020-12-01T00:00:00.000Z&dateTo=2020-12-31T23:59:59.999Z" -H "Accept: application/json" -H "Fiware-Service: atos" -H "Fiware-ServicePath: /mtp"

contains field dateFrom and dateTo but as per quantumleap's API specification it should be fromDate and toDate (which worked perfectly fine).

So, the API used by the user is wrong which results in this behavior.

Kindly let me know if anything needs to be updated in code or document part.

c0c0n3 commented 2 years ago

@pooja1pathak that's great, thank you so much for getting into the bottom of this! Since the user called the API with the wrong parameter (dateTo instead of toDate) there's nothing for us to fix---yay! The user should simply replace the dateTo param name w/ toDate like you said.

I don't have a stackoverflow account so I can't comment there, but if any of you does, please just mention on stackoverflow dateTo isn't part of the API spec so it's ignored. To make the query work the user should set the toDate param instead.

c0c0n3 commented 2 years ago

@chicco785 maybe you can just link @pooja1pathak's comment in the stackoverflow ansewer?

chicco785 commented 2 years ago

@chicco785 maybe you can just link @pooja1pathak's comment in the stackoverflow ansewer?

done, thanks a lot @pooja1pathak !