I'm trying to get all documents between two dates using groovy. I've tried several approaches and haven't been successful. Most lately I've tried the approach listed here Java/MongoDB query by date
Here is my code :
BasicDBObject query = new BasicDBObject("lastDate", //
new BasicDBObject("$gte",start).append("$lt", end));
def temp= getDB().sysLog.find(query)
However I get the error :
No such property: gte for class: dev.ReportController Possible solutions: DB
I can't figure out why this approach will not work. It looks as if groovy handles the "$gte" differently then Java which makes sense but I'm not sure how I should format the request.