MongoDB - Geospatial Index with Aggregation
问题 I've read from the to docs that it is not possible to use a geospatial index on an aggregation with MongoDB. Is there an alternative to this? I am attempting to run a query take grab all activities within a certain radius, then group/sort them by the number of times that activity has occurred. Is there way around this issue? 回答1: You can use map-reduce on a geo query. Here is an example based on geo_mapreduce.js (from the mongodb jstests): // setup test collection var act_date = new Date(2010