🦹 Advanced
Geo-spatial fields
Dynamic mapping does not support geo-spatial fields, and require a manual/static mapping configuration.
Here's a document with a Point
field:
{
_id: 1,
city: "Charlottesville",
location: {
type: "Point",
coordinates: [-78.47668,38.02931]
}
}
To map that GeoJSON location
field to a geo
type in Atlas Search:
{
"mappings": {
"dynamic": true,
"fields": {
"location": {
"type": "geo"
}
}
}
}
geo-spatial search operators
near
operator
Operates on numbers and dates, but trickier than equals
, in
, and range
- near operator
- Playground TODO: number
near
- Playground TODO: date
near