Page 1 of 1

Greater than Date not working in query

Posted: Fri Feb 28, 2014 2:01 pm
by Bad Addy

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


Greater than Date not working in query

Posted: Fri Feb 28, 2014 2:33 pm
by Maryna Brodina

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


Greater than Date not working in query

Posted: Fri Feb 28, 2014 2:40 pm
by Bad Addy

perfect!

Thank you :)