开发者

Mongodb dynamic geo queries

Mongodb geo queries allows to query documents within some geometry (box, circle, polygon), but geomerty param is static.

In my application geometry parameters depends on each document. Is it possible to solve this with Mongodb geo queries or not?开发者_运维问答

For example: Dealer is working in some region described by polygon. I need to find all dealers for my current location.


There isn't a way to dynamically specify different geometries when the query is executing, as per the documentation here.

However, you could do something like convert all the polygons to a box that approximates the bounding area of the n-sided polygon you have for each dealer. Then, just use a box for all of them. It isn't perfect but it works and solves the problem.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜