Reputation: 17448
How do I manually generate an ObjectID if I need to insert a document to a MongoDB?
Is it possible to do with shell?
Thanks
Upvotes: 2
Views: 6203
Reputation: 559
Yes it's possible,
Enter mongo shell (type mongo in terminal) and over there simply write:
new ObjectId()
This will return you a new ObjectId as you wish
Upvotes: 7