I am new at using MongoDB. I have it filled with receipts, for example: one receipt looks like this :
{
\"_id\" : {
\"$oid\" : \"510fa057c6f818
MongoDB dates work in conjunction with java.util.Date. Change your query to something like this :
Date start = new java.util.Date(2012, 06, 20, 10, 05);
Date end = new java.util.Date(2012, 06, 20, 10, 30);
BasicDBObject query = new BasicDBObject("Date",
new BasicDBObject("$gt", start)).
append("$lte", end) ));