Spring data mongodb search for ISO date
Query would execute perfect from Spring data mongodb0
{ "dob" : { "$lte" : { "$date" : "2015-05-16T07:55:23.257Z"}}}.
But It will not execute from mongo CLI.
Query to execute on cli.
{dob:ISODate("2015-05-15T07:55:23.257Z")}
Thanks
This code should work fine for what you need:
criteria = Criteria.where("dob").lte(new java.util.Date());
My test is with following code, which does work fine:
Lis<User> users = mongoOps.find(query(where("isActive").is(true).and("CreatedDate").lte(new java.util.Date())), User.class);