Tutorial by Examples

How to find documents created 60 seconds ago seconds = 60 gen_time = datetime.datetime.today() - datetime.timedelta(seconds=seconds) dummy_id = ObjectId.from_datetime(gen_time) db.CollectionName.find({"_id": {"$gte": dummy_id}}) If you're in a different timezone, y...

Page 1 of 1