title: morphia and howto update existing document field
body: <p>Im completely new to MongoDb and Morphia and<br>
  trying to learn how to update my document.   </p>
  
  <p>I cannot see/understand how to do it from this page:<br>
  <a href="http://code.google.com/p/morphia/wiki/Updating" rel="noreferrer">http://www.mongodb.org</a>  </p>
  
  <p>My Document looks as following:(could be some error here)</p>
  
  <pre><code>@Entity
  public class UserData {
  
      private Date creationDate;
      private Date lastUpdateDate;
  
      @Id private ObjectId id;
      public String status= "";
      public String uUid= "";
  
  
      public UserData() {
          super();
          this.statistic = new Statistic();
          this.friendList = new FriendList();
      }
  
      @Embedded
      private Statistic statistic;
      @Embedded
      private FriendList friendList;
  
      @PrePersist
      public void prePersist() {
          this.creationDate = (creationDate == null) ? new Date() : creationDate;
          this.lastUpdateDate = (lastUpdateDate == null) ? creationDate : new Date();
      }
  }
  </code></pre>
  
  <p>On that page i cannot see any place where they describe howto update my <code>UserData</code> that has a specific <code>uUid</code><br>
  Like <code>update UserData.status</code> if <code>uUid=123567</code>   </p>
  
  <p>This is what i think i should use: </p>
  
  <pre><code>ops=datastore.createUpdateOperations(UserData.class).update("uUid").if uuid=foo..something more here..
  </code></pre>
  
  <p>// morphia default update is to update all the UserData document so howto update selected ones</p>
  
  <pre><code>datastore.update(datastore.createQuery(UserData.class), ops);  
  </code></pre>