title: ArrayFilter updateMany query works in console, but fails to work with mogoose
body: <p>I'm using mongoose version 5.11.12, and my mongo cluster is running 4.4.3, and lastly my node is: 10.19.0.</p>
  <p>When i try this query:</p>
  <pre><code>Group.updateMany({},
      {$push:{&quot;threads.$[elem].messages&quot;:&quot;hello&quot;}},
  {multi:true ,arrayFilters:[{&quot;elem._id&quot;:&quot;602645582fa6cb13f8449057&quot;}]},
      (err,result) =&gt;{
          if(err)res.json({error:err}); else res.json({result:result});
          
      }
  )
  </code></pre>
  <p>it does nothing to the database, and then only returns an unhelpful error object of <code>{}</code>.</p>
  <p>However when i run the equivalent query of this directly into the mongo console:</p>
  <pre><code>db.groups.updateMany({},{$push:{&quot;threads.$[elem].messages&quot;:&quot;hello&quot;}},{multi:true ,arrayFilters:[{&quot;elem._id&quot;:ObjectId(&quot;602645582fa6cb13f8449057&quot;)}]})
  </code></pre>
  <p>and the expected response of:</p>
  <pre><code>{ &quot;acknowledged&quot; : true, &quot;matchedCount&quot; : 2, &quot;modifiedCount&quot; : 1 }
  </code></pre>
  <p>At first, i thought it might be an issue with the ObjectId casting, but i messed with the objectId so it was no longer a valid object id, and it gave the expected objectId error so it seems unlikely that it is that causing the issue.</p>
  <p>If it helps, this is what the relevant section of my database looks like:</p>
  <pre><code>{
      &quot;_id&quot; : ObjectId(&quot;60264286f5440e114c189212&quot;),
      &quot;members&quot; : [ ],
      &quot;name&quot; : &quot;Computer Science London&quot;,
      &quot;location&quot; : {
              &quot;coordinates&quot; : [
                      51.503391,
                      -0.12763
              ],
              &quot;_id&quot; : ObjectId(&quot;60264286f5440e114c189213&quot;),
              &quot;type&quot; : &quot;Point&quot;
      },
      &quot;description&quot; : &quot;A group for computing students to learn, talk and share!&quot;,
      &quot;pictureURL&quot; : &quot;/images/computer.jpg&quot;,
      &quot;threads&quot; : [
              {
                      &quot;_id&quot; : ObjectId(&quot;602645582fa6cb13f8449057&quot;),
                      &quot;title&quot; : &quot;What is a lambda function&quot;,
                      &quot;openingPost&quot; : &quot;I am reading this textbook and it mentions this thing called a lambda function, but it doesnt seem to outline what it is. Can someone help me understand?&quot;,
                      &quot;postedBy&quot; : &quot;ElBarto88&quot;,
                      &quot;updatedAt&quot; : ISODate(&quot;2021-02-12T09:07:36.833Z&quot;),
                      &quot;createdAt&quot; : ISODate(&quot;2021-02-12T09:07:36.833Z&quot;),
                      &quot;messages&quot; : [
                              &quot;hello&quot;
                      ]
              },
              {
                      &quot;_id&quot; : ObjectId(&quot;602645af2fa6cb13f8449058&quot;),
                      &quot;title&quot; : &quot;How do i install linux?&quot;,
                      &quot;openingPost&quot; : &quot;This server assignment requires i have linux installed, how do install it?&quot;,
                      &quot;postedBy&quot; : &quot;ElBarto88&quot;,
                      &quot;updatedAt&quot; : ISODate(&quot;2021-02-12T09:09:03.123Z&quot;),
                      &quot;createdAt&quot; : ISODate(&quot;2021-02-12T09:09:03.123Z&quot;),
                      &quot;messages&quot; : [ ]
              }
      ],
      &quot;createdAt&quot; : ISODate(&quot;2021-02-12T08:55:34.273Z&quot;),
      &quot;updatedAt&quot; : ISODate(&quot;2021-02-12T09:09:03.123Z&quot;),
      &quot;__v&quot; : 0
  </code></pre>
  <p>}</p>