I try to select all rows from a MongoDB, where the field "updatedOn" (Format: DateTime) is newer than the current Time - 90 Days.
My first try was:
{"updatedOn": {"$gt": new Date(ISODate().getTime() - 1000 * 3600 * 24 * 90)} }
That gives me a parsing Error to JSON. Error: MongoDB Input (1): Got parse error at "D", position 28: "SPECIAL_EXPECTED": could not parse JSON document
Is it not possible to use thenew Date(ISODate().getTime() ? Or does anybody knows what I'm doing wrong ?
Thx
Patrik
Could you select All records from Mongo and use a standard Filter tool to do the T - 90? Not the most efficient, but when it comes to Mongo, I am happy to settle for 'it works'
Yes, we could do that... that would work, but the main reason for this "updatedOn" Timestamp is that we don't have to read the whole Database. We have a performance issue with the MongoDB.