简体   繁体   English

mongodb如何查找排除区域,$ geoExclusion?

[英]mongodb how to find exclude areas, $geoExclusion?

There is a $geoIntersection. 有一个$ geoIntersection。 But does it exist something similar to $geoExclusion? 但是它是否存在类似于$ geoExclusion的东西? I would like to find polygons that do not intersect to certain areas. 我想找到不与某些区域相交的多边形。

Try using $not : 尝试使用$not

db.places.find({ "loc" : { "$not" : { "$geoIntersects" : { 
    "$geometry" : { 
        "type" : "Polygon", 
        "coordinates" : [[ [ 0, 0 ], [ 3, 6 ], [ 6, 1 ], [ 0, 0 ] ]] 
    } 
} } } })

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM