title: Update a HashMap directly in Mongo with Java (Spring boot)
body: <p>I want to store a structure that contain a map inside mongoDb to have a document like this :</p>
  <pre><code>{ 
      &quot;_id&quot; : ObjectId(&quot;id&quot;), 
      &quot;createdDate&quot; : ISODate(&quot;2013-04-06T15:22:34.530Z&quot;) 
      &quot;map&quot; : [
          { name: String(&quot;random_1&quot;) ,
            age: 35) },
          { name: String(&quot;random_2&quot;) , 
            age: 25) },
          { name: String(&quot;random_3&quot;) , 
            age: 23) 
          } 
      ],
  }
  </code></pre>
  <p>Then, I want directly to put or delete keys inside the map using FindAndModify.
  I usualy do this with lists, and it work like a charm :</p>
  <pre><code> var query = new Query();
       query.addCriteria(Criteria.where(&quot;id&quot;).is(myId));
  
   var update = new Update();
       Optional.ofNullable(myList).map(e -&gt; update.push(&quot;myList&quot;)..each(e));
  </code></pre>
  <p>but never done this before with maps,  is it even possible?</p>