I am new at using MongoDB. I have it filled with receipts, for example: one receipt looks like this :
{
\"_id\" : {
\"$oid\" : \"510fa057c6f818
You could try:
Date gtDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS").parse("2012-06-20T10:05:21.968");
Date lteDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS").parse("2012-09-24T05:29:43.031");
BasicDBObject dateQueryObj = new BasicDBObject("Date", new BasicDBObject("$gt", gtDate).append("$lte", lteDate));
DBCursor cursor = collection.find(dateQueryObj);