Advertisement
rodrigosantosbr

[Py] Generate hex-24 objectid (mongo)

Feb 21st, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.08 KB | None | 0 0
  1. # pymongo
  2. from bson.objectid import ObjectId
  3. _id = ObjectId()
  4. # hex 24
  5. print(_id)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement