title: Mongodb query to check if a particular field is not null ( aggregation)
body: <p>I have queries like</p>
  <pre><code>{
  &quot;title&quot;: &quot;sjncx&quot;,
  &quot;desciption&quot;: &quot;cknxk jckd&quot;,
  &quot;price&quot;: &quot;29.99&quot;,
  &quot;stock&quot;: &quot;3&quot;,
  ...
  }
  </code></pre>
  <p>I need to filter data if the title <code>is not empty</code>.( title exists and not null). And also <code>is empty</code> like ~ <code>title: &quot;&quot;</code> ~ ( so title exists but empty)</p>
  <p>I tried for <code>is not empty</code>:</p>
  <p><code>{'title': {'$ne': 'null'}}</code></p>
  <p>I tried for <code>is empty</code>:</p>
  <p><code>{'title': {'$type': 10}}</code></p>
  <p>That doesn't work. What would be the reason?</p>