Geospatial operators return data based on geospatial expression conditions.地理空间运算符根据地理空间表达式条件返回数据。
Query Predicate Operators查询谓词运算符
$geoIntersects | $geoIntersects.2dsphere索引支持$geoIntersects。 |
$geoWithin | $geoWithin.2dsphere和2d索引支持$geoWithin。 |
$near | 2dsphere and 2d indexes support $near.2dsphere和2d索引支持$near。 |
$nearSphere | 2dsphere and 2d indexes support $nearSphere.2dsphere和2d索引支持$nearSphere。 |
Geometry Specifiers几何体规范
Use the following specifiers in geospatial query predicates to specify geometric elements to query against.在地理空间查询谓词中使用以下说明符指定要查询的几何元素。
$box | $geoWithin queries. $geoWithin查询指定矩形框。$box.2d索引支持$box。 |
$center | $geoWithin queries when using planar geometry. $geoWithin查询。2d index supports $center.2d索引支持$center。 |
$centerSphere | $geoWithin queries when using spherical geometry. $geoWithin查询指定圆。$centerSphere.2dsphere和2d索引支持$centerSphere。 |
$geometry | |
$maxDistance | $near and $nearSphere queries. $near和$nearSphere查询的结果。2dsphere and 2d indexes support $maxDistance.2dsphere和2d索引支持$maxDistance。 |
$minDistance | $near and $nearSphere queries. For use with 2dsphere index only.$near和$nearSphere查询结果的最小距离。仅适用于2dsphere索引。 |
$polygon | $geoWithin queries. $geoWithin查询指定使用传统坐标对的多边形。2d index supports $polygon.$polygon。 |