Skip to content

AVVSDevelopment/timestamp-objectId

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

...

About

converts timestamp to ObjectID, useful for querying mongodb

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published