title: create Index on Loc in mongoDB
body: <h1>Problem</h1>
  
  <p>I want to create index on location with lat lng key value. 
  I have done so far is that </p>
  
  <blockquote>
    <p>db.collection.createIndex( { "loc" : "2dsphere" } )</p>
  </blockquote>
  
  <p>How can I achieve this </p>
  
  <pre><code>{
      "_id" : "14613879205654654648572",        
      "birthDate" : ISODate("1992-07-17T00:00:00.000Z"),
      "loc" : {
          "lat" : 31.5200788,
          "lng" : 74.3236112
      }
  }
  </code></pre>