title: MongoDb Update multiple documents with different values using Spring Data mongo
body: <p>Using spring data mongo driver, I want to update multiple documents in mongodb using one single query and these documents will have a different updated value.
  I tried the following code but it would have the same updated value for all the documents that match the query criteria.</p>
  
  <pre><code>List&lt;Criteria&gt; bigCriteria = new ArrayList&lt;Criteria&gt;();
  
  for (MyClass myClass : myClasses){
              Criteria criteria = Criteria.where("_id").is(myClass.getId());
              bigCriteria.add(criteria);
  }
  
  //next line is just a psedudo code to explain what I intend to do here
  query = &lt;&lt;create an or query using bigCriteria created above&gt;&gt;;
  
  Update update = new Update();
  update.set("age":11);
  
  mongoOperation.updateMulti(query, update, User.class);
  </code></pre>
  
  <p>Is there a way to update all the documents with different values ?</p>