title: Querying a Sub Object in MongoDB is not using the Index
body: <p>I am recording site usage events in a sub object of a (visitor). here is a basic example of the data structure:</p>
  
  <pre><code>{ "_id" : ObjectId("4d4c695794b332a0740009bd"), "evs" : [
      {
              "ev" : "Visit Home Page",
              "d" : 1,
              "s" : 1
      },
      {
              "ev" : "Buy Product",
              "d" : "110.10",
              "upc" : 1234,
              "s" : 1
      },
      {
              "ev" : "Sign up to newsletter",
              "d" : "1",
              "s" : 1
      }
  ]}
  </code></pre>
  
  <p>I have an index on 'evs.s', but when I search on evs.s, the index is not used:</p>
  
  <pre><code>db.visitors.find({'evs.s':0}).explain()
  {
      "cursor" : "BtreeCursor evs.s_1",
      "nscanned" : 33361,
      "nscannedObjects" : 33361,
      "n" : 33361,
      "millis" : 311,
      "nYields" : 105,
      "nChunkSkips" : 0,
      "isMultiKey" : false,
      "indexOnly" : false,
      "indexBounds" : {
              "evs.s" : [
                      [
                              0,
                              0
                      ]
              ]
      }
  }
  </code></pre>
  
  <p>That query takes 311 milliseconds and scans through every object.</p>
  
  <p>Here is the index: db.visitors.getIndexes()</p>
  
  <pre><code>{
    "ns" : "tracking.visitors",
    "unique" : false,
    "key" : {
       "evs.s" : 1
    },
    "name" : "evs.s_1",
    "v" : 0
  }
  </code></pre>