title: Mongodb $exists with $or
body: <p>Let's say i have the following documents collection named students</p>
  
  <pre><code>{name:'John',age:16,address:'New Orleans',subject:'Maths'}
  
  {name:'John',age:18,subject:'Maths'}
  </code></pre>
  
  <p>Now,if i want to query the documents where the subject is Maths and address is either 'New Orleans' or it doesn't exists then:</p>
  
  <pre><code>db.students.find({subject:'Maths',$or:[{address:{$exists:false}},{address:'New Orleans'}]})
  </code></pre>
  
  <p>But on doing the above query i only get the one with the address 'New Orleans' and not the other where i don't have the address field</p>
  
  <p>What i'm i doing wrong? Any help appreciated.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>This question has been resolved. <strong>Was not a query issue.</strong> Thanks to everyone for helping out.</p>