title: Creating a Geospatial Index on MongoDB
body: <p>I am using the Geospatial Feature of MongoDB and my typical document looks like:</p>
  
  <pre><code>{
      "_id" : ObjectId("574ebe5f9985eb31a9bdbe39"),
      "geoareaName" : "GEOAREA2",
      "loc" : {
          "type" : "Polygon",
          "coordinates" : [
              [
                  [
                      13.870663396091308,
                      3.481292724609375
                  ],
                  [
                      13.875996314658366,
                      3.482236862182617
                  ],
                  [
                      13.872746581997381,
                      3.484210968017578
                  ],
                  [
                      13.871829982503106,
                      3.484961986541748
                  ],
                  [
                      13.870663396091308,
                      3.481292724609375
                  ]
              ]
          ]
      },
      "color" : "#ff0000",
      "_version" : 4,
      "active" : false
  }
  </code></pre>
  
  <p>and then there are some point locations which I query using the <code>$geoIntersects</code> keyword and it works like a charm. However, to optimally use the geospatial feature of mongo I want to put indexes around the location.</p>
  
  <p>Can someone please suggest what should be the correct approach for that.</p>