title: MongoDB not querying `null` within a array at a given posision correctly
body: <p>I'm having a hard time understanding why the following happens within mongodb when dealing with nulls and array indexes within queries.</p>
  
  <p>Say we have the following:</p>
  
  <pre><code>&gt; db.test.find()
  { "_id" : ObjectId("5852da24507d8c27f4e3c357"), "item" : null }
  { "_id" : ObjectId("5852da2d507d8c27f4e3c358"), "item" : { "something" : true } }
  { "_id" : ObjectId("5852da33507d8c27f4e3c359") }
  </code></pre>
  
  <p>When I try to find items that are null I get <code>ObjectId("5852da24507d8c27f4e3c357")</code> and <code>ObjectId("5852da33507d8c27f4e3c359")</code> which is as expected based on <a href="https://docs.mongodb.com/v3.2/tutorial/query-for-null-fields/" rel="nofollow noreferrer">https://docs.mongodb.com/v3.2/tutorial/query-for-null-fields/</a></p>
  
  <pre><code>&gt; db.test.find({"item" : null})
  { "_id" : ObjectId("5852da24507d8c27f4e3c357"), "item" : null }
  { "_id" : ObjectId("5852da33507d8c27f4e3c359") }
  </code></pre>
  
  <p>But when I try to do the same but within a array with a given index, It's completely different set of results:</p>
  
  <p>Say we have the following:</p>
  
  <pre><code>&gt; db.test.find()
  { "_id" : ObjectId("5852dbe1507d8c27f4e3c35c"), "a" : [ { "something" : true }, { "something" : true }, null ] }
  { "_id" : ObjectId("5852dbf4507d8c27f4e3c35d"), "a" : [ { "something" : true }, { "something" : true }, { "something" : true } ] }
  { "_id" : ObjectId("5852dbfb507d8c27f4e3c35e"), "a" : [ { "something" : true }, { "something" : true } ] }
  </code></pre>
  
  <p>But If I do the query based on the index of 2 is null, we still get returned all the documents:</p>
  
  <pre><code>&gt; db.test.find({"a.2": null})
  { "_id" : ObjectId("5852dbe1507d8c27f4e3c35c"), "a" : [ { "something" : true }, { "something" : true }, null ] }
  { "_id" : ObjectId("5852dbf4507d8c27f4e3c35d"), "a" : [ { "something" : true }, { "something" : true }, { "something" : true } ] }
  { "_id" : ObjectId("5852dbfb507d8c27f4e3c35e"), "a" : [ { "something" : true }, { "something" : true } ] }
  </code></pre>
  
  <p>This to me doesn't seem like its working as expected? But we can however see that the index position works correctly as we can do the following query:</p>
  
  <pre><code>&gt; db.test.find({"a.2": {something:true}})
  { "_id" : ObjectId("5852dbf4507d8c27f4e3c35d"), "a" : [ { "something" : true }, { "something" : true }, { "something" : true } ] }
  </code></pre>
  
  <p>Is this a bug within mongodb and dealing with arrays and nulls?</p>