0

I'm trying to find out which objects in a collection were created between two dates, by using their _ids:

db.landmarks.find( { _id: { $gte:  new Date(2014, 9, 1), $lt:  new Date(2014, 10, 1), } } )

This query isn't returning results

alyx
  • 2,593
  • 6
  • 39
  • 64
  • 3
    See http://stackoverflow.com/questions/8749971/can-i-query-mongodb-objectid-by-date – JohnnyHK Oct 24 '14 at 03:03
  • Just in case, you may want to know this: the `ObjectId` generation rule varies between different drivers. Some of them even use pure `string` instead of `ObjectId`. – yaoxing Oct 24 '14 at 09:01

0 Answers0