Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Greater than Date not working in query

I have the following code, can you see why it would not pull any info where the group_type and group_name are correct, and the date in the database is later than the take set in the query:

precode
where:{"$and" : [{"group_name": "A Name"}, {"group_type" : "Local Government"}, {"createdAt" : {"$gt" : "2014-02-28 13:54:00.000"}}]}
count:1
/code/pre

I get no errors, but the 'createdAt' on the collection is later than the current date, so it should return 1 row

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Greater than Date not working in query

Hello! Try this way pre{"_createdAt":{"$gt":{"$date":"2014-01-01T17:55:54.129Z"}}}/pre

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Greater than Date not working in query

perfect!

Thank you :)

Return to “Issues”