I want to limit a query I\'m making to only look in documents that were created in the past 24 hrs.
What is the best way to structure this query? How do I go about
If you're not using any other indexes and are using the default ObjectID as your _id, you can do the following:
var ObjectID = require('mongodb').ObjectID db.collection.find({ _id: { $gt: ObjectID.createFromTime(Date.now() / 1000 - 24*60*60) } }, callback)