Hi,
I’m working with Java driver and need to query all documents between some date. Following an example of one document
{
_id: ObjectId(“xyz”),
name: ‘xxxxx’,
surname: ‘yyyyy’,
timestamp: ‘1686787260’,
timeField: ISODate(“2023-06-15T00:01:00.000Z”)
}
since now I used to query by “timestamp” using this query and worked fine:
“query”: {
“timestamp”:{ “$gte”: “$1”, “$lte”: “$2” }
},
but now I need to query for timeField and the following doesn’t seems to work:
“query”: {
“timeField”:{ “$gte”: “ISODate($1)”, “$lte”: “ISODate($2)” }
},
Could you please show me possible options to solve this matter?
Thanks