GEORADIUS_RO
Deprecated: use GEOSEARCH instead.
GEORADIUS_RO key longitude latitude radius <M | KM | FT | MI> [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count [ANY]] [ASC | DESC]
- Group
- Geospatial
- Complexity
- O(N + log M), N being the members in the area searched
- Arity
- -6 (at least 6 words, counting the command name)
- Flags
- read-only
- Keys
- first 1, last 1, step 1
- HotKV Cloud
- All plans
- On-Premise
- no license needed
GEORADIUS_RO works like GEORADIUS but is flagged as
a read-only command, so it runs on read-only replicas and in read-only
scripts. It does not accept STORE or STOREDIST.
New code should use GEOSEARCH with FROMLONLAT and
BYRADIUS.
Options
Section titled “Options”WITHCOORD, WITHDIST, WITHHASH, COUNT count [ANY], ASC and DESC, as
for GEORADIUS.
Return value
Section titled “Return value”| Case | RESP2 | RESP3 |
|---|---|---|
| Matches | Array of members, or of arrays with the extra fields | Same; coordinates are doubles |
| No matches, or no such key | Empty array | Empty array |
STORE or STOREDIST reply ERR syntax error. Other errors are those of
GEORADIUS, including WRONGTYPE.
Examples
Section titled “Examples”127.0.0.1:6379> GEOADD cities 4.3517 50.8503 brussels 4.9041 52.3676 amsterdam(integer) 2127.0.0.1:6379> GEORADIUS_RO cities 4 51 120 mi1) "brussels"2) "amsterdam"127.0.0.1:6379> GEORADIUS_RO cities 4 51 120 mi STORE out(error) ERR syntax errorCompatibility
Section titled “Compatibility”Same as Redis 7 and Valkey 8, where it is also deprecated. Results are always sorted by distance; see GEOSEARCH.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.