I have a collection in Mongo called 'collectionX'. I want to query whole data, except I want to filter out by event_date that is after July 1st (event, creationdate - unix milisecond timestamp). However I am using this query in azure data copy tool and I get an error of an invalid use of filtering.
db.CollectionX.find({
"events": {
"$elemMatch": {
"creationDate.$date": { "$gt": NumberLong(1725072000000) }
}
}
})
Tried multiple queries, do I write Mongo queries here or something else?
json structure ->
"_identitificationID": {
"$originalID": "xyz123"
},
"events": [
{
"_identificationID": {
"$originalID": "xyz1234"
},
"messageId": "thatsmymessage",
"creationDate": {
"$date": 1671023788998
},
"myinformationID": "abc",
"otherinfo": "123",
"eventname": "somethinghappened"
},
creationDateactually contain a document with a field$date?{"$date": 1671023788998}looks like MongoDB extended JSON. JSON doesn't have a Date datatype, so that may indicate that the field actually contains a UTC datetime.