I have a collection of polygons in a geojson format and I'm trying to find for one polygon, its neighbors.
I tried to use the $geoIntersects
operator like so
coords = [...] # some coordinates of a polygon of my collection
db.coll.find({
"loc": {
"$geoIntersects": {
"$geometry": {
"type": "Polygon" ,
"coordinates": coords
}
}
}
})
It didn't give me any results.
For clarification here two polygons that are next to one another and I'm trying to find one when I'm calling my function with the other. They do not need to share exactly one full side, just a portion of it.
Is that something that's doable with mongo? Or should I aim for another strategy?