title: Use mongo positional operator ($) and find in multiple arrays
body: <p>Let me extend the example <a href="https://docs.mongodb.org/manual/reference/operator/update/positional/#update-documents-in-an-array" rel="nofollow">from the docs</a> to:</p>
  
  
  
  <pre class="lang-js prettyprint-override"><code>{
    _id: 4,
    tags: ['good', 'great', 'nice'], 
    grades: [
       { grade: 80, mean: 75, std: 8 },
       { grade: 85, mean: 90, std: 5 },
       { grade: 90, mean: 85, std: 3 }
    ]
  }
  </code></pre>
  
  <p>Now I want to update all <code>grade=85</code> which have also an tag <code>good</code>. I would try to use:</p>
  
  <pre class="lang-js prettyprint-override"><code>db.students.update(
     { tags: "good", "grades.grade": 85 },
     { $set: { "grades.$.std" : 6 } }
  )
  </code></pre>
  
  <p>However, mongo will set the <code>$</code> to <code>0</code> because the tag <code>good</code> is the first in the tag list. This causes the data to change to:</p>
  
  <pre class="lang-js prettyprint-override"><code>{
    _id: 4,
    tags: ['good', 'great', 'nice'], 
    grades: [
       { grade: 80, mean: 75, std: 6 }, //←wrong
       { grade: 85, mean: 90, std: 5 },
       { grade: 90, mean: 85, std: 3 }
    ]
  }
  </code></pre>
  
  <p><strong>Question:</strong> Is there a way to tell mongo and/or mongoose to use the position in grades to reference the grade?</p>