I have stored polygons in the database that cross over the x and y axes and I want to search for polygons that contain a given point. To do so, I am using the $geoIntersects operator to specify a point, however, MongoDB does not return any polygons when they cross over an axis. Are there any small changes I can make to my query or schema that will allow for this?
The query:
{
polygon: {
$geoIntersects: {
$geometry: {
type: 'Point',
coordinates: [long, lat]
}
}
}
}
The object in the database:
polygon: {
type: 'Polygon',
name: 'Name',
coordinates: [[
[-180, -90],
[-180, 90],
[180, 90],
[180, -90],
[-180, -90]
]]
}