Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

GEORADIUSBYMEMBER

Last updated

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.

The same as GEORADIUS: WITHCOORD, WITHDIST, WITHHASH, COUNT count [ANY], ASC, DESC, STORE key and STOREDIST key.

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.

127.0.0.1:6379> GEOADD cities -0.1276 51.5072 london 2.3522 48.8566 paris 4.3517 50.8503 brussels
(integer) 3
127.0.0.1:6379> GEORADIUSBYMEMBER cities paris 300 km
1) "paris"
2) "brussels"
127.0.0.1:6379> GEORADIUSBYMEMBER cities atlantis 300 km
(error) ERR could not decode requested zset member

Same as Redis 7 and Valkey 8, where it is also deprecated. Results are always sorted by distance; see GEOSEARCH.

GEOSEARCH, GEOSEARCHSTORE, GEORADIUSBYMEMBER_RO, GEORADIUS