mongodb geospatial query for multyindex data
<p>I have a collection of like so :</p>

<p><code>db.records.save( {
  name : "John Smith",
  addresses : [ {
                 context : "home" ,
                 loc : [ 55.5, 42.3 ]
                } ,
                {
                 context : "work",
                 loc : [ -74 , 44.74 ]
                }
              ]
} )</code></p>

<p>And I've created an index like this:</p>

<p><code>db.records.createIndex( { "addresses.loc": "2d" } )</code></p>

<p>Now when I try and make a query like: </p>

<p><code>db.Company.findOne({ "stores.loc" : { $near :[55.5, 42.3]}})</code></p>

<p>What I expect to get is john smite with an array of addresses with <strong>only</strong> the relevant address, what I get is john smite with all of the addresses, So I do not know.</p>

<p>How do I solve this?</p>