Neatly Prepared Mustache
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

timestamp-objectid

0.1.1 • Public • Published

Be able to query mongodb records in the given timeperiod by ObjectId

var timestampToObjectId = require('timestamp-objectId');
// timestampToObjectId = function(timestamp)
// timestamp could be both String and actual Timestamp

db.mycollection.find({
  _id: {
    $gt: timestampToObjectId('1980/05/25'),
    $lt: timestampToObjectId(1367413318476)
  }
});

...

Keywords

none

install

npm i timestamp-objectid

Downloadsweekly downloads

107

version

0.1.1

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability