title: How to update the _id of one MongoDB Document?
body: <p>I want update an <code>_id</code> field of one document. I know it's not really good practice. But for some technical reason, I need to update it.</p>
  <p>If I try to update it I get:</p>
  <pre><code>db.clients.update({ _id: ObjectId(&quot;123&quot;)}, { $set: { _id: ObjectId(&quot;456&quot;)}})
  
  Performing an update on the path '_id' would modify the immutable field '_id'
  </code></pre>
  <p>And the update is rejected. How I can update it?</p>