mongodb - How to convert from Timestamp to Mongo ObjectID -


i know can use gettimestamp() retrieve timestamp objectid, there way generate objectid timestamp?

more specifically, if have input of month , year, want convert mongo objectid query in db, how should this?

an objectid() 12-byte bson type , consists of:

  • the first 4 bytes representing seconds since unix epoch
  • the next 3 bytes machine identifier
  • the next 2 bytes consists of process id
  • the last 3 bytes random counter value

clearly, not able create objectid() timestamp.


Comments

Popular posts from this blog

Lists in Python -

android - can not access to progress bar in an other activity -

java - Vaadin 7 Pass Data Between Views -