Skip to main content

Usage

Parameters

key
string
required
The key containing the geospatial index.
centerPoint
CenterPoint
required
The center point to search from:
shape
Shape
required
The search area shape:
order
'ASC' | 'DESC' | 'asc' | 'desc'
required
Sort order:
  • ASC - Sort by distance from center (nearest first)
  • DESC - Sort by distance from center (farthest first)
options
GeoSearchCommandOptions
Optional search options:

Response

result
GeoSearchResponse[]
An array of search results, each containing:

Examples

Search by radius from coordinates

Search from existing member

Include distance and coordinates

Limit results

Search by rectangular box

Sort by distance descending

Include all metadata

Important Notes

Performance Considerations

  • Use count.any: true for better performance when you don’t need exact ordering of all results
  • Smaller search areas are faster than larger ones
  • Consider using BYBOX for rectangular areas instead of very large radius searches

Coordinate Order

Note that centerPoint uses lon and lat (shortened forms) while the response coord uses long and lat:

Distance Units

UnitAbbreviation
MetersM
KilometersKM
FeetFT
MilesMI