I want to use Jongo for date queries. The user should be able to enter a string with the query, so I want to use the find method with a string. I am using groovy.
My code:
jongo.getCollection("mycollection").find("{birthday: {\$lt : ISODate(\"2012-11-23T00:13:00.000Z\")}}")
I get this exception:
java.lang.IllegalArgumentException: Cannot parse query: {birthday: {$lt : ISODate("2012-11-23T00:13:00.000Z")}}
Error |
at org.jongo.query.BsonQueryFactory.createQuery(BsonQueryFactory.java:162)
Error |
at org.jongo.Find.<init>(Find.java:47)
Error |
at org.jongo.MongoCollection.find(MongoCollection.java:84)
Error |
at org.jongo.MongoCollection.find(MongoCollection.java:80)
What am I doing wrong?