title: update an element in deeply nested array after checking multiple conditions in MongoDB
body: <p>Say, I have a document structure</p>
  
  <pre><code>[ {
    "name" : "in",
    "states" : [ {"name" : "up", 
                  "cities" : [ {"name" : "dp", "places" : [ {"name" : "pvr"}, {"name" : "lpu"} ] }, 
                              {"name" : "mo", "places" : [ {"name" : "pvr"}, {"name" : "lpu"} ] } ]}, 
                 {"name" : "tn", 
                 "cities" : [ {"name" : "ab", "places" : [ {"name" : "pvr"}, {"name" : "lpu"} ] }, 
                              {"name" : "cd", "places" : [ {"name" : "pvr"}, {"name" : "lpu"} ] } ]} 
               ]
    },
    {
    "name" : "ik",
    "states" : [ {"name" : "up", 
                  "cities" : [ {"name" : "dp", "places" : [ {"name" : "pvr"}, {"name" : "ont"} ] }, 
                              {"name" : "lo", "places" : [ {"name" : "zcv"}, {"name" : "bft"} ] } ]}, 
                 {"name" : "kl", 
                 "cities" : [ {"name" : "hp", "places" : [ {"name" : "bgh"}, {"name" : "vhi"} ] }, 
                              {"name" : "mp", "places" : [ {"name" : "hup"}, {"name" : "plm"} ] } ]} 
               ]
  } ]
  </code></pre>
  
  <p>I would like to change the <code>"{"name" : "pvr"}"</code> to <code>"{"name" : "cvr"}"</code> of "<code>places</code>" where <code>("name":"ik" and "states.name":"up" and "cities.name":"dp")</code>. How to check for all three conditions and update?</p>