title: MongoDB find documents with a field not empty, IF EXISTS
body: <p>I want to be able to query documents having a specific field's value not empty, if the field is present. Normally I'd do something like:</p>
  <pre><code>client_comment: { '$exists': true, '$ne': null },
  '$expr': { '$eq': [ { &quot;$ne&quot;: &quot;$client_comment&quot; }, null ] },
  </code></pre>
  <p>The thing is, some of the records have this field, some of them don't... and some of them are empty strings. I want to exclude those who have <code>client_comment</code> value as empty strings but I don't know how do I do that.</p>
  <pre><code>{
      &quot;_id&quot; : ObjectId(&quot;5e0b1b094dfee4f3a2f4f62a&quot;),
      &quot;name&quot; : &quot;Jane Doe&quot;,
      &quot;email&quot; : &quot;john_doe@gmail.com&quot;,
      &quot;status&quot; : &quot;done&quot;,
      &quot;created_date&quot; : ISODate(&quot;2021-10-03T19:38:56.462Z&quot;),
      &quot;updated_date&quot; : ISODate(&quot;2021-10-03T19:38:56.462Z&quot;),
  }
     
  {
      &quot;_id&quot; : ObjectId(&quot;5e0b1b094dcee4f3a2f4f62a&quot;),
      &quot;name&quot; : &quot;Lorem Ipsum&quot;,
      &quot;email&quot; : &quot;test@gmail.com&quot;,
      &quot;status&quot; : &quot;done&quot;,
      &quot;created_date&quot; : ISODate(&quot;2021-10-03T19:38:56.462Z&quot;),
      &quot;updated_date&quot; : ISODate(&quot;2021-10-03T19:38:56.462Z&quot;),
      &quot;client_comment&quot; : &quot;Lorem ipsum&quot;,
  }
  
  // Exclude this record from the result
  {
      &quot;_id&quot; : ObjectId(&quot;5e0b1b094dfef4f3a2f4f62a&quot;),
      &quot;name&quot; : &quot;John Doe&quot;,
      &quot;email&quot; : &quot;jane.doe@gmail.com&quot;,
      &quot;status&quot; : &quot;done&quot;,
      &quot;created_date&quot; : ISODate(&quot;2021-10-03T19:38:56.462Z&quot;),
      &quot;updated_date&quot; : ISODate(&quot;2021-10-03T19:38:56.462Z&quot;),
      &quot;client_comment&quot; : &quot;&quot;,
  }
  </code></pre>