cts query to filter documents from a particular collection for the last 24 hours
I have been trying to find the documents from a particular collection based on the field report_time.
I have been trying the below query. But, it doesn't work.
cts.andQuery(cts.collectionQuery('myCollection'),cts.jsonPropertyRangeQuery("report_time", ">", new Date(Date.now() - 86400 * 1000).toISOString()))
From that snippet, the one thing that needs adjustment is that the query criteria need to be in an array for the cts.andQuery()
param:
cts.andQuery([
cts.collectionQuery('myCollection'),
cts.jsonPropertyRangeQuery("report_time", ">", new Date(Date.now() - 86400 * 1000).toISOString())
])