title: Query for boolean field as "not true" (e.g. either false or non existent)
body: <p>I'm sure I'm missing something very basic in MongoDB queries, can't seem to get this simple condition.</p>
  
  <p><strong>Consider this collection</strong> </p>
  
  <pre><code>&gt; db.tests.find()
  { "_id" : ObjectId("..."), "name" : "Test1" , "deleted" : true}
  { "_id" : ObjectId("..."), "name" : "Test2" , "deleted" : false}
  { "_id" : ObjectId("..."), "name" : "Test3" }
  </code></pre>
  
  <p>I would simply like to query all the items that are "not deleted"</p>
  
  <p>I know how to find the item that has a "deleted" flag set to true: </p>
  
  <pre><code>&gt; db.tests.find({deleted:true})
  { "_id" : ObjectId("..."), "name" : "Test1" , "deleted" : true}
  </code></pre>
  
  <p>But how do I find all items that are NOT <code>"deleted"</code> (e.g. negate the above query, or in other words, any items that either doesn't have a <code>"deleted"</code> field, or have it with value <code>false</code></p>
  
  <p><strong>What I tried by guessing</strong> (please don't laugh...)</p>
  
  <pre><code>&gt; db.tests.find({$not : {deleted: true}})
  </code></pre>
  
  <p>(returns no results)</p>
  
  <pre><code>&gt; db.tests.find({$not : {$eq:{deleted:true}}})
  </code></pre>
  
  <p>error: { "$err" : "invalid operator: $eq", "code" : 10068 }</p>
  
  <pre><code>&gt; db.tests.find({deleted:{$not: true}})
  </code></pre>
  
  <p>error: { "$err" : "invalid use of $not", "code" : 13041 }</p>
  
  <pre><code>&gt; db.tests.find({deleted:{$not: {$eq:true}}})
  </code></pre>
  
  <p>error: { "$err" : "invalid use of $not", "code" : 13034 }</p>
  
  <p>What am I missing? </p>