title: Mongodb does not perform update of document after updating only part of a document's field
body: <p>I'm using spring boot version 1.4.2 and mongodb 3.4.2</p>
  
  <p>When I use the repository interface to persist an already existing document after making a change to one of the properties of the document, the old document gets saved. For example:</p>
  
  <pre class="lang-java prettyprint-override"><code>@Document(collection="UserDoc)
  public class UserDoc{
  @Id
  private String id;    
  private String userName;
  private String passWord;
  private int age;
  //getters and setters...
  }
  @Autowired
  private UserDocRepository userDocRepository;
  UserDoc userDoc = userDocRepository.findOne("dummyId");
  //assume the id passed in is correct and a UserDoc is returned.
  //now when i change one of the fields,eg the age and save it back,the old 
  //value gets persisted,eg if age is 10 and i change it to 5,the old property  
  //is still persisted to db unless i Create a new UserDoc and copy all the 
  //properties before it gets persisted with the correct value of 5.
  userDoc.setAge(5);
  userDocRepository.save(userDoc);//this is supposed to update the document 
  //with a new value of 5 instead of 10 as it was probably per the assumption.
  
  UserDoc userDocUpdated = new UserDoc();
  userDocUpdated.setId(userDoc.getId);
  userDocUpdated.setUserName(userDoc.getUserName);
  userDocUpdated.setPassWord(userDoc.getPassWord);
  userDocUpdated.setAge(5); //this way,the document is updated with 5 as the 
  //age
  
  userDocRepository.save(userDocUpdated);//this updates it accordingly with 
  //the desired value of 5 for the age
  </code></pre>
  
  <p>What could be the problem with the first scenario?Could it be a problem with mongodb or spring boot?Any insights will be gladly appreciated. </p>