title: MongoDb query array with null values
body: <p>I have objects in my collection that look like:</p>
  
  <pre><code>{ MyArray:[null, "some value", null] }
  </code></pre>
  
  <p>I want to query those objects that have a null value as an array element. The query </p>
  
  <pre><code>db.collection.find({"MyArray":null})
  </code></pre>
  
  <p>does not work, it seems to find only the objects with MyArray being null, e.g.</p>
  
  <pre><code>{ MyArray:null }
  </code></pre>
  
  <p>How do I need to define my query?</p>
  
  <p>EDIT: Please see one of my real objects:</p>
  
  <pre><code>{
          "_id" : BinData(3,"ch9PrWveqU6niB6FGVhIOg=="),
          "PeerGroup" : "male",
          "ProductId" : BinData(3,"weRiKOtXEUSDZHkGHLcwzw=="),
          "CategoryIds" : [
                  BinData(3,"BXzpwVQozECLaPkJy26t6Q=="),
                  BinData(3,"ox303ZeM50KelvoUbPBJ8Q=="),
                  BinData(3,"26ziaY+G9UKMyjmtVkkhcg=="),
                  BinData(3,"D2X8vObte0eJHNcDfp2HBw==")
          ],
          "ShopId" : BinData(3,"ZdfPmrlKR0GkLPC4djJuKw=="),
          "BrandId" : BinData(3,"kCHyuyLvgECxPF1nxwr7qQ=="),
          "Created" : ISODate("2012-08-24T07:42:12.416Z"),
          "LastActivity" : ISODate("2013-01-14T19:38:11.776Z"),
          "Price" : 129.9,
          "Sale" : false,
          "Rating" : 11.057340703605368,
          "RatingTimed" : 0.05670431130054035,
          "Available" : null,
          "FreeDelivery" : null,
          "Attrs" : [
                  null,
                  null,
                  null,
                  null
          ]
  }
  </code></pre>
  
  <p>And then I query by:</p>
  
  <pre><code>db.collection.find({"Attrs":null})
  </code></pre>
  
  <p>which yields no results.</p>