开发者

How to workaround MongoDB's current limitation of just one geospatial index per collection?

开发者 https://www.devze.com 2023-03-17 08:01 出处:网络
Currently, MongoDB supports only one geospatial index pe开发者_如何学Pythonr collection. How can I workaround this manually?

Currently, MongoDB supports only one geospatial index pe开发者_如何学Pythonr collection. How can I workaround this manually?

Is there some smart way to emulate this kind of index without losing too much accuracy?


You probably can create a second collection, which will hold only the (same) object-id, and the secondary geospatial index.

when you want to query for the secondary index, you'd query that second collection, get the list of ids back, and then query the master collection by ids.

0

精彩评论

暂无评论...
验证码 换一张
取 消