On this page
地理空间查询运算符
在本页面
Note
有关特定运算符的详细信息,包括语法和示例,请单击特定运算符以转到其参考页。
Operators
Query Selectors
| Name | Description |
|---|---|
| $geoIntersects | 选择与GeoJSON几何相交的几何。 2dsphere索引支持$geoIntersects。 |
| $geoWithin | 在边界GeoJSON geometry内选择几何。 2dsphere和2d索引支持$geoWithin。 |
| $near | 返回点附近的地理空间对象。需要地理空间索引。 2dsphere和2d索引支持$near。 |
| $nearSphere | 返回球体上某个点附近的地理空间对象。需要地理空间索引。 2dsphere和2d索引支持$nearSphere。 |
Geometry Specifiers
| Name | Description |
|---|---|
| $box | 使用$geoWithin查询的旧版坐标对指定一个矩形框。 2d索引支持$box。 |
| $center | 使用平面几何时,使用旧坐标对$geoWithin查询来指定一个圆。 2d索引支持$center。 |
| $centerSphere | 使用球形几何图形时,使用传统坐标对或GeoJSON格式为$geoWithin查询指定一个圆。 2dsphere和2d索引支持$centerSphere。 |
| $geometry | 为地理空间查询运算符指定GeoJSON格式的几何。 |
| $maxDistance | 指定最大距离以限制$near和$nearSphere查询的结果。 2dsphere和2d索引支持$maxDistance。 |
| $minDistance | 指定最小距离以限制$near和$nearSphere查询的结果。仅与2dsphere索引一起使用。 |
| $polygon | 指定用于对$geoWithin查询使用旧坐标对的面。 2d索引支持$center。 |
| $uniqueDocs | 不推荐使用。修改$geoWithin和$near查询,以确保即使文档多次匹配查询,查询也只返回一次文档。 |