$geometryThe
$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:$geometry: { type: "<GeoJSON object type>", coordinates: [ <coordinates> ] } Para especificar um polígono GeoJSON com um MongoDB CRS personalizado, utilize o seguinte protótipo (disponível somente para
$geoWithine$geoIntersects):$geometry: { type: "Polygon", coordinates: [ <coordinates> ], crs: { type: "name", properties: { name: "urn:x-mongodb:crs:strictwinding:EPSG:4326" } } } O sistema de referência de coordenadas MongoDB personalizado tem uma rigorosa ordem de enrolamento no sentido anti-horário.
Importante
Se especificar coordenadas de latitude e longitude, liste a longitude primeiro e então a latitude.
Os valores de longitude válidos estão entre
-180e180, ambos inclusos.Os valores de latitude válidos estão entre
-90e90, ambos inclusos.