title: How to implement a custom filter with mongodb schema?
body: <p>I need to know is there any method that I can implement to have a custom filter for a complex search?</p>
  <p>For example,</p>
  <pre><code>User.someMethodName((eachUser) =&gt; {
     const temp = eachUser.temperature;
     if(temp.mesure === 'C' &amp;&amp; temp.value &gt; 36) return true;
     if(temp.mesure === 'F' &amp;&amp; convertToCel(temp.value) &gt; 36) return true;
     return false;
  })
  </code></pre>
  <p>something like this. I know that I can await User.find({}) and use the array filter method on it to filter but my concern is that in that case, I wouldn't be able to do my pagination which I can do with mongoose limit(), skip() methods.</p>
  <p>Any help would be highly appreciated. Thanks!</p>
  <p>Edit: Just found out can use aggregate with $redact to achieve this, but still not figured out how exactly implement it to meet this need.</p>