title: MongoDB how using Spring Cryteria remove element from nested object array
body: <p>In my project I'm using SpringBoot 1.3.2 and org.springframework.data.mongodb.core.query.*</p>
  
  <p>I'm trying to remove element from nested object array, in my main object i have array looking like this:</p>
  
  <pre><code>"sections" : [
          {
                  "sectionId" : "56cc3c908f5e6c56e677bd2e",
                  "name" : "Wellcome"
          },
          {
                  "sectionId" : "56cc3cd28f5e6c56e677bd2f",
                  "name" : "Hello my friends"
          }
  ]
  </code></pre>
  
  <p>Using Spring I want to delete record with sectionId 56cc3c908f5e6c56e677bd2e</p>
  
  <p>This is way I'm trying do this:</p>
  
  <pre><code>  Query query = Query.query(Criteria
                  .where("sections")
                  .elemMatch(
                          Criteria.where("sectionId").is("56cc3c908f5e6c56e677bd2e")
                  )
          );
          Update update = new Update().unset("sections.sectionId");
          mongoTemplate.updateMulti(query, update, Offer.class);
  </code></pre>
  
  <p>Query is finding propper element but there is something wrong with Update and I don't know what so removing is not working.</p>
  
  <p>Could any body can help me with this?</p>