我尝试使用geoNear和组聚合(其他选项也很好)来进行以下操作
loc (2dsphere indexed)和user_id字段的文档user_id有许多loc(前)
{"user_id":1, "loc": { "type": "Point", "coordinates": ... }}
{"user_id":1, "loc": { "type": "Point", "coordinates": ... }}
{"user_id":2, "loc": { "type": "Point", "coordinates": ... }}loc中使用user_id。我认为它可以按照组和geoNear的顺序进行聚合,但是文档告诉我,geoNear必须比其他的优先。
我怎么能做到呢?
发布于 2017-05-24 13:13:45
https://stackoverflow.com/questions/43536346
复制相似问题