$geoIntersects
db.getCollection('geo').find({
boundary: {
$geoIntersects: {
$geometry: {
type: type,
coordinates: coor
}
}
}
})
Notes
1. type值首字母必须大写,如’Polygon’,而’polygon’无法查询。
2. coordinates:当type为’Polygon’时,coor的值必须为数组,结构为[[[a1,b1],[a2,b2],[a3,b3]...]]
,否则会报错。