Details
-
Type: Monitor
-
Status: Closed
-
Priority: Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: FIWARE-TECH-HELP
-
Labels:
Description
Created question in FIWARE Q/A platform on 11-06-2021 at 07:06
Please, ANSWER this question AT https://stackoverflow.com/questions/67932711/fiware-quantum-leap-date-query
Question:
Fiware Quantum Leap Date Query
Description:
I am currently using Quantum Leap/CrateDB to persist time series data through the Orion Context Broker.
After setting up the notification on Orion I can query data.
curl -X GET "http://localhost:8668/v2/entities/urn:ngsi-ld:Pmr_obs:001/attrs/slotStatus?limit=3" -H "Accept: application/json" -H "Fiware-Service: atos" -H "Fiware-ServicePath: /mtp"
Response
{
"attrName": "slotStatus",
"entityId": "urn:ngsi-ld:Pmr_obs:001",
"index": [
"2019-07-28T19:00:00.000+00:00",
"2019-07-29T07:00:00.000+00:00",
"2019-07-29T10:00:00.000+00:00"
],
"values": [
0,
1,
0
]
}
But when I try to query data over a specific period (between two dates), the server returns all the indices and the values and not for the period I select.
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"
Response (all the values from 2019 to end of 2020)
What is strange is that if I use an aggregate method it filters the data correctly using the specific date period.
curl -X GET "http://localhost:8668/v2/entities/urn:ngsi-ld:Pmr_obs:001/attrs/slotStatus?aggrMethod=count&dateFrom=2020-12-01&dateTo=2020-12-31" -H "Accept: application/json" -H "Fiware-Service: atos" -H "Fiware-ServicePath: /mtp"
Response
{
"attrName": "slotStatus",
"entityId": "urn:ngsi-ld:Pmr_obs:001",
"index": [],
"values": [
1101
]
}
What should I do to only query data from a specific period without an aggregate method?
Thanks in advance.
quantumleap:0.8
crate:4.1.4
2021-06-12 05:31|CREATED monitor | # answers= 0, accepted answer= False