title: Spring Mongo Upsert nested document
body: <p>I am new bie to spring framework. I have my mongo document like</p>
  
  <pre><code>{
      "_id" : ObjectId("527242d584ae917d8bd75c7b"),
      "postTitle" : "Car",
      "postDesc" : "rent",
      "owner" : ObjectId("526a588f84aed6f41cca10bd"),
      "intrest" : []
  }
  </code></pre>
  
  <p>What I want is to search document having id</p>
  
  <pre><code>"_id" : ObjectId("527242d584ae917d8bd75c7b")
  </code></pre>
  
  <p>and update it to </p>
  
  <pre><code>{
      "_id" : ObjectId("527242d584ae917d8bd75c7b"),
      "postTitle" : "Car",
      "postDesc" : "rent",
      "owner" : ObjectId("526a588f84aed6f41cca10bd"),
      "intrest" : [
          {
              "userId" : ObjectId("526a587d84aed6f41cca10bc"),
              "timestamp" : ISODate("2013-10-31T11:45:25.256Z")
  
          },
          {
              "userId" : ObjectId("526a587d84aed6f41cca10bc"),
              "timestamp" : ISODate("2013-11-31T11:55:25.256a")
  
          }
  
  ]
  }
  </code></pre>
  
  <p>my domain is</p>
  
  <pre><code>@Document
  public class Post {
  
       @Id
       private ObjectId _id;
       private String postTitle;
       private String postDesc;
       private ObjectId owner=Global.getCurruser();
       private List&lt;Intrest&gt; intrest = new ArrayList&lt;Intrest&gt;();
  
  // Getters and setters
  }
  
  @Document
  public class Intrest {
  
          private ObjectId userId;
      private Date timestamp;
  
  // Getters and setters
  }
  </code></pre>
  
  <p>What upsert should I write to add or modify entries in intrest array[].</p>
  
  <p>Please Help.</p>