Ok, I suppose that this is a silly question and probably has a simple answer.

How can I duplicate a document in MongoDB, changing the _id of the new one?

Imaging that you have the original document:

> var orig = db.MyCollection.findOne({_id: 'hi'})

And now I want another document in the collection with _id 'bye'.

Edit
Report