title: MongoDB Array Filters
body: <p>I am trying to update an nested array using Array filters, for hands on first i am trying with basic array filter update query, i copied pasted the update query from the mongodb tutorial, But i am getting error like: Error:"No array filter found for identifier 'elem' in path 'grades.$[elem].mean'
  "and i am using 
  'db version v4.0.2' and 
  'MongoDB shell version v4.0.2</p>
  
  <p>Here is my collection Details,</p>
  
  <pre><code>              {
                "_id" : 1,
                "grades" : [ 
                {
                "grade" : 80,
                "mean" : 75,
                "std" : 6
                }, 
                {
                "grade" : 85,
                "mean" : 90,
                "std" : 4
                }, 
                {
                "grade" : 85,
                "mean" : 85,
                "std" : 6
                }
                ]
                }
               //End of First Record
                {
                "_id" : 2,
                "grades" : [ 
                 {
                "grade" : 90,
                "mean" : 75,
                "std" : 6
                }, 
                {
               "grade" : 87,
               "mean" : 90,
               "std" : 3
               }, 
               {
              "grade" : 85,
              "mean" : 85,
              "std" : 4
              }     
              ]
              }
              //End of Second record 
  </code></pre>
  
  <p>update Query:</p>
  
  <pre><code>          db.getCollection('students2').update(
  
           {   },
           { $set: { "grades.$[elem].mean" : 100 } },
           {
            multi: true,
            arrayFilters: [ { "elem.grade": { $gte: 85 } } ]
            }
            )
  </code></pre>
  
  <p>Throw's the  Error:
  No array filter found for identifier 'elem' in path 'grades.$[elem].mean'</p>