I\'m beginning with mongodb, and I\'m trying to query my db that have this document format:
{ \"_id\" : ObjectId(\"520b8b3f8bd94741bf006033\"), \"value\" : 0
You could also do below
db.getCollection('collectionName').find({timestamp : {$gte: new Date().getTime()-(60*60*1000) } } )
The above query ll give you records of timestamp b/w now and 60 mins. if you like more then 60 mins - say 2 hrs you could change expression to (2*60*60*1000) for 30 mins (30*60*1000)