You have a collection named restaurants with the geographical information stored in the location property, how do you create a geospatial index on it?

  •  db.restaurants.CreateIndex({location: “2dsphere”})
  •  db.restaurants.geospatial({location: “2dsphere”})
  •  db.restaurants.CreateIndex(“2dsphere”:”location”)
  •  db.restaurants.CreateIndex({geospatial: “location”})

Leave a Reply

Your email address will not be published. Required fields are marked *