title: $expr with $regexMatch doesn't work when the pattern is inside an array
body: <p>Based in <a href="https://stackoverflow.com/a/69979596/1485926">this example</a>, I'm using <code>$expr</code> and <code>$regexMatch</code> to implement &quot;reverse regex&quot; queries in MongoDB. For instance <a href="https://mongoplayground.net/p/ibWLonDkxFT" rel="nofollow noreferrer">this example works</a></p>
  <p>However, this only seems to work when the regex is in a first level field in the MongoDB document. In the case the regex is within an element in an array (as in <a href="https://mongoplayground.net/p/IeXsLOrU7LD" rel="nofollow noreferrer">this other example</a> I get errors like this:</p>
  <pre><code>query failed: (Location51105) Executor error during find command :: caused by :: $regexMatch needs 'regex' to be of type string or regex
  </code></pre>
  <p>Is there any way of supporting this case?</p>