Usage
Parameters
The key to store the geospatial index.
One or more geospatial members to add. Each member includes:
Optional configuration:
Response
The number of elements added to the sorted set (not including elements already existing for which the score was updated).Returns
null when used with xx or nx options and the conditions are not met.Examples
Add a single location
Add multiple locations
Only add new locations (nx)
Update existing locations only (xx)
Important Notes
Coordinate Order
Redis stores geospatial data as a sorted set using the Geohash technique. The coordinate order is longitude first, then latitude:Valid Ranges
- Longitude: -180 to 180 degrees
- Latitude: -85.05112878 to 85.05112878 degrees