- Reference >
- Operators >
- Query and Projection Operators >
- Geospatial Query Operators >
- $geometry
$geometry¶
-
$geometry¶ New in version 2.4.
Changed in version 3.0: Add support to specify single-ringed GeoJSON polygons with areas greater than a single hemisphere.
The
$geometryoperator specifies a GeoJSON geometry for use with the following geospatial query operators:$geoWithin,$geoIntersects,$near, and$nearSphere.$geometryusesEPSG:4326as the default coordinate reference system (CRS).To specify GeoJSON objects with the default CRS, use the following prototype for
$geometry:New in version 3.0: To specify a single-ringed GeoJSON polygon with a custom MongoDB CRS, use the following prototype (available only for
$geoWithinand$geoIntersects):The custom MongoDB coordinate reference system has a strict counter-clockwise winding order.
Important
If you use longitude and latitude, specify coordinates in order of: longitude, latitude.