title: Mongoose find the first nearest location
body: <p>In my MongoDB database I have tons of location <strong>(coordinates can be duplicated)</strong>. I'm trying to get the first nearest location (longitude / latitude). Inside my model I have this :</p>
  
  <pre><code>var mySchema = new Schema({
      loc:{
          type : [Number],
          index: '2d'
      },
      ...
  });
  </code></pre>
  
  <p>I see than MongoDB implement <code>$near</code> method to calculate the nearest locations. Then I tried this</p>
  
  <pre><code>Model.find({loc: {$near:[1.4072964, 7.826107], $maxDistance: 1} }, function(err, result){
      result.forEach(function(doc){
          console.log(doc.loc)
      })
  }); 
  </code></pre>
  
  <p>The problem is that it will returns all locations nearest to this point around 1 meter. But I don't need max distance I just want the first nearest  location found.</p>
  
  <p>I can't use <code>findOne</code> for this because I need to get all duplicated data for this first location. </p>
  
  <p>E.g. If the first coordinate found is <code>-5.95001220703125, 51.5499954223633</code> and I have this location 10 times, I need to get all documents with this locations.</p>
  
  <p>So it's possible to do this with just once Mongoose Query ? Or I shouldn't use the MongoDB Geospatial Indexing and calculate the nearest distance myself in my application ?</p>