title: MongoDB spatial query - error unable to find index or no results
body: <p>I am having trouble while executing some spatial queries in MongoDb. I have a collection "cities15000" for which every record has this format </p>
  
  <pre><code>"_id" : ObjectId("5624aefe4728347a51b1d751"),
  "geonameid" : "292932",
  "name" : "Ajman",
  "asciiname" : "Ajman",
  "latitude" : "25.41111",
  "longitude" : "55.43504",
  "feature_code" : "PPLA",
  "country_code" : "AE",
  "population" : "226172",
  "elevation" : "",
  "timezone" : "Asia/Dubai",
  "geography" : {
      "type" : "Point",
      "loc" : [ 
          "55.43504", 
          "25.41111"
      ]
  } 
  </code></pre>
  
  <p>I have created a 2dsphere index <code>db.cities15000.ensureIndex({loc : '2dsphere'})</code> and then i tried to get results using <code>$near</code> or <code>$geonear</code>.</p>
  
  <p>While using $near <code>db.cities15000.find({loc: {$near: [55.400 ,25.400]} })</code> i get this error message </p>
  
  <blockquote>
    <p><code>Unable to execute query: error processing query...n planner returned
    error: unable to find index for $geoNear query"</code></p>
  </blockquote>
  
  <p>which means that i have a wrong index (i think).</p>
  
  <p>But then when i use <code>db.runCommand({geoNear: "cities15000",near: { type: "Point", coordinates: [ 55.400 ,25.400 ] },spherical: true})</code>
  i get: </p>
  
  <pre><code>{
  "results" : [],
  "stats" : {
      "nscanned" : 0,
      "objectsLoaded" : 0,
      "avgDistance" : NaN,
      "maxDistance" : 0.0000000000000000,
      "time" : 0
  },
  "ok" : 1.0000000000000000
  } 
  </code></pre>
  
  <p>which means that it doesn't find anything near (false). there are many similar topics but i have tried what is proposed there and nothing worked. </p>