I am trying to search for date of birth using query
criteria = Criteria.where("dob").lte(new DateTime().toDate());
And spring data mongodb generate below query:
MongoTemplate: find using query:
{ "dob" : { "$lte" : { "$date" : "2015-05-16T07:55:23.257Z"}}}
fields: null for class: class com.temp.model.User in collection: user
But I did not get any result.
My dob field in mongodb:
{"dob" : ISODate("1991-01-23T00:00:00Z")}
How I can search for dob in ISODate format ?