MongoDb

From Hawk Wiki
Revision as of 22:31, 1 January 2018 by Hall (Talk | contribs)

Jump to: navigation, search

Search by timestamp

search from a certain timestamp

db.getCollection('XXX').find({t: {$gte: new ISODate("2018-01-01T21:56:47Z")}});

search last 5 minutes

db.getCollection('XXX').find({t: {$gte: new Date(ISODate().getTime() - 1000 * 60 * 5)}})