I have 2 fields like this in my document
"DATE_1" : ISODate("2017-08-11T04:00:00Z")
"DATE_2" : ISODate("2017-06-12T04:00:00Z")
I would like to select documents with "DATE_1" is greater than "DATE_2" and i tried the following query which should return the above document.But its not giving any result
db.collection.find({"DATE_1":{$gte:"DATE_2"}})
How do I compare 2 ISODate fields in Mongo? Also how do I make this query using Spring date mongodb? something like this?
Criteria.where("DATE_1").gte("DATE_2");