$geometry¶The $geometry operator specifies a GeoJSON geometry for use with the following geospatial query operators: $geoWithin, $geoIntersects, $near, and $nearSphere. $geometry运算符指定一个GeoJSON几何体,用于以下地理空间查询运算符:$geoWithin、$geoIntersects、$near和$nearSphere。$geometry uses 使用EPSG:4326 as the default coordinate reference system (CRS).EPSG:4326作为默认坐标参考系(CRS)。
To specify GeoJSON objects with the default CRS, use the following prototype for 要使用默认CRS指定GeoJSON对象,请为$geometry:$geometry使用以下原型:
To specify a single-ringed GeoJSON polygon with a custom MongoDB CRS, use the following prototype (available only for 要使用自定义MongoDB CRS指定单个环形GeoJSON多边形,请使用以下原型(仅适用于$geoWithin and $geoIntersects):$geoWithin和$geoIntersects):
The custom MongoDB coordinate reference system has a strict counter-clockwise winding order.自定义MongoDB坐标参考系具有严格的逆时针缠绕顺序。
Important
If specifying latitude and longitude coordinates, list the longitude first and then latitude:如果指定纬度和经度坐标,请先列出经度,然后列出纬度:
-180 and 180, both inclusive.-180和180之间,两者都包括在内。-90 and 90, both inclusive.-90和90之间,两者都包括在内。