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)
  }
});

...

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.1
    898
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.1
    898
  • 0.1.0
    1

Package Sidebar

Install

npm i timestamp-objectid

Weekly Downloads

6

Version

0.1.1

License

MIT

Last publish

Collaborators

  • avvs