title: Cannot test mongo aggregation MongoError: Unrecognized pipeline stage name: '$set'
body: <p>Im using mongo aggregation with mongoose. It works fine, but fails when run in jest.</p>
  <p>I get the error:</p>
  <pre><code>MongoError: Unrecognized pipeline stage name: '$set'
  </code></pre>
  <p>when using $set inside an aggregation</p>
  <pre><code>$set: {
              isUsersContent: {
                $eq: [&quot;$teacher._id&quot;, user._id],
              },
        }
  </code></pre>
  <p>&quot;mongoose&quot;: &quot;^5.3.12&quot;,
  &quot;jest&quot;: &quot;^25.1.0&quot;,</p>