Geo Search using Mongo $geoWithin and $geoIntersects #2984
Replies: 2 comments
-
I doubt this will be a priority so any advice on how to get this functionality will be greatly appreciated. I was hoping that I could build a custom resolver or use a field hook, but I have not found a straightforward way to do something like this. Thinking I may have to build my own database connection or expose this data through an external API endpoint... |
Beta Was this translation helpful? Give feedback.
-
This functionality would have to be built into core, and I think this is something that we'd be willing to accept a PR for. As of now, we support the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In my use case, I have a relationship that is determined by GeoJSON point in one collection (e.g. Business) and GeoJSON polygon in another collection (e.g. Neighborhood).
When I want to find the businesses in a neighborhood, I use $geoWithin to see which businesses are within the neighborhood's polygon.
When I want to find the neighborhoods for a business, I use the $geoIntersects to see where the business point intersects with a neighborhood polygon.
Beta Was this translation helpful? Give feedback.
All reactions