title: Can MongoDB use an index when checking for existence of a field with $exists operator?
body: <p>If I have data in my <code>users</code> collection that looks like:</p>
  
  <pre><code>{ name: '...', 
    email: '...', 
    ...,
    photos: {
       123: { url: '...', title: '...', ... },
       456: { url: '...', title: '...', ... },
       ...
    }
  } 
  </code></pre>
  
  <p>And I want to find which user owns photo id 127, then I am using the query:</p>
  
  <pre><code>db.users.find( {'photos.127': {'$exists' =&gt; true} } );
  </code></pre>
  
  <p>I've tried, but it doesn't seem possible to get MongoDB to use an index for this query. The index I tried was: <code>db.users.ensureIndex({photos:1});</code>.  And when I used <code>explain()</code> mongo told me it was using a BasicCursor (i.e., no index was used).</p>
  
  <p>Is it possible to create an index that mongo will use for this query?</p>