GEORADIUSBYMEMBER
Deprecated: use GEOSEARCH and GEOSEARCHSTORE instead.
GEORADIUSBYMEMBER key member radius <M | KM | FT | MI> [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count [ANY]] [ASC | DESC] [STORE key | STOREDIST key]
- Group
- Geospatial
- Complexity
- O(N + log M), N being the members in the area searched
- Arity
- -5 (at least 5 words, counting the command name)
- Flags
- write
- Keys
- first 1, last 1, step 1
- HotKV Cloud
- All plans
- On-Premise
- no license needed
GEORADIUSBYMEMBER works like GEORADIUS, but the
center of the search is the position of member, which is itself part of
the results. GEOSEARCH key FROMMEMBER member BYRADIUS radius unit does the
same.
Options
Section titled “Options”The same as GEORADIUS: WITHCOORD, WITHDIST, WITHHASH,
COUNT count [ANY], ASC, DESC, STORE key and STOREDIST key.
Return value
Section titled “Return value”| Case | RESP2 | RESP3 |
|---|---|---|
Without STORE |
Array of members, or of arrays with the extra fields | Same; coordinates are doubles |
With STORE or STOREDIST |
Integer: members stored | Integer |
If member is not in a non-empty set, the reply is
ERR could not decode requested zset member. A missing key gives an empty
array (or stores nothing). Other errors are those of GEORADIUS, including
WRONGTYPE.
Examples
Section titled “Examples”127.0.0.1:6379> GEOADD cities -0.1276 51.5072 london 2.3522 48.8566 paris 4.3517 50.8503 brussels(integer) 3127.0.0.1:6379> GEORADIUSBYMEMBER cities paris 300 km1) "paris"2) "brussels"127.0.0.1:6379> GEORADIUSBYMEMBER cities atlantis 300 km(error) ERR could not decode requested zset memberCompatibility
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.