Store location data in Mongodb document
问题 In my current project , I am storing the location data in the following format in a Mongodb document "location" : { "loc" : { "lng" : -118.15592692, "lat" : 34.03566804 }, "geocode" : { "city" : "East Los Angeles", "state" : "CA", "zipcode" : "90022", "countrycode" : "US", "country" : "United States" } } There is a 2d index created on location.loc field:- { "location.loc" : "2d" } But the geospatial queries are taking long time when the result set is large i.e more than 7000 records. it seems