title: Updating _id field in MongoDB
body: <p>I want to update my _id field in one of the document ( shown below ). </p>
  
  <pre><code>{
  _id : ObjectId("586d9d5d23352af1a4aa05f7"),
  name: "Soham",
  age : 99,
  city : "XYZ"
  }
  </code></pre>
  
  <p>So I ran the below steps:</p>
  
  <pre><code>var doc = db.names.find({name:"Soham"});
  doc._id = 111 ; -- 111 is not present in that collection for any document
  db.names.remove({_id:ObjectId("586d9d5d23352af1a4aa05f7")});
  db.names.insert(doc);
  </code></pre>
  
  <p>The first 3 lines haven't threw any error, but the moment I ran the insert command, it threw error. Can anyone please let me know what's going wrong.</p>
  
  <p>Thanks in advance!!!</p>