Mongodb $GEOIN和$GEOSINTERSECTS运算符之间的差异?

Mongodb $GEOIN和$GEOSINTERSECTS运算符之间的差异?,mongodb,geospatial,mongo-java,Mongodb,Geospatial,Mongo Java,mongoDB中的$geoIntersects和$geoIntersects操作符有什么区别 如果我正在查找坐标(使用默认坐标参照系),$geointen和$geocursects将返回相同的结果 如果我错了,请纠正我 任何理解差异的简单用例都将不胜感激 来自: 选择其地理空间数据与指定的GeoJSON对象相交的文档;i、 e.数据与指定对象的交点为非空。这包括数据和指定对象共享一条边的情况 发件人: 选择包含完全存在于指定形状中的地理空间数据的文档 以以下为例: > db.test.dr

mongoDB中的
$geoIntersects
$geoIntersects
操作符有什么区别

如果我正在查找坐标(使用默认坐标参照系),
$geointen
$geocursects
将返回相同的结果

如果我错了,请纠正我

任何理解差异的简单用例都将不胜感激

来自:

选择其地理空间数据与指定的GeoJSON对象相交的文档;i、 e.数据与指定对象的交点为非空。这包括数据和指定对象共享一条边的情况

发件人:

选择包含完全存在于指定形状中的地理空间数据的文档

以以下为例:

> db.test.drop()
> var poly1 = { "type" : "Polygon", "coordinates" : [[[0, 0], [3, 0], [0, 3], [0, 0]]] }
> var poly2 = { "type" : "Polygon", "coordinates" : [[[1, 1], [2, 1], [1, 2], [1, 1]]] }
// poly1 is a similar triangle inside poly2
> var poly3 = { "type" : "Polygon", "coordinates" : [[[1, 0], [-2, 0], [1, 3], [1, 0]]] }
// poly3 is poly1 flipped around its "vertical" edge, then bumped over one unit, so it intersects poly1 but is not contained in it
> db.test.insert({ "loc" : poly2 })
> db.test.insert({ "loc" : poly3 })
> db.test.ensureIndex({ "loc" : "2dsphere" })
> db.test.find({ "loc" : {
    "$geoIntersects" : {
        "$geometry" : poly1
    }
} })
// poly2 and poly3 returned
> db.test.find({ "loc" : {
    "$geoWithin" : {
        "$geometry" : poly1
    }
} })
// poly2 returned