title: MongoDB field order and document position change after update
body: <p>I am learning MongoDB and I noticed that whenever I do an update on a document the field being updated is pushed to the end of the order, so if I had something like:</p>
  
  <pre><code>db.collection.save({field1: value1, field2: value2, ..., field 10: value10});
  db.collection.update({field1: value1}, {$set: {field2: new_value}});
  </code></pre>
  
  <p>then if you do:</p>
  
  <pre><code>db.collection.find();
  </code></pre>
  
  <p>it will display:</p>
  
  <pre><code>{ "field1":"value1", ..., "field10":"value10", "field2":"new_value"}
  </code></pre>
  
  <p>You can see how the field order changes where the updated field is being pushed to the end of the document. In addition, the document itself is being pushed to the end of the collectoin. I know that it's a "schema-less" DB and it may not be a huge problem, but it just doesn't look "pretty" :). Is there a way to do an in-place update without changing the order?</p>