- db.restaurants.CreateIndex({location: “2dsphere”})
- db.restaurants.geospatial({location: “2dsphere”})
- db.restaurants.CreateIndex(“2dsphere”:”location”)
- db.restaurants.CreateIndex({geospatial: “location”})
You have a collection named restaurants with the geographical information stored in the location property, how do you create a geospatial index on it?
June 25, 2021June 25, 2021
0 Comment