# GEORADIUSBYMEMBER

> Find members of a geospatial index within a radius of another member (legacy form of GEOSEARCH).

URL: https://docs.hotkv.com/commands/georadiusbymember/

```
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
- HotKV Cloud: all plans
- On-Premise: no license needed
- Deprecated: use GEOSEARCH and GEOSEARCHSTORE instead

`GEORADIUSBYMEMBER` works like [GEORADIUS](https://docs.hotkv.com/commands/georadius/index.md), 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

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

## 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

```
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
```

## Compatibility

Same as Redis 7 and Valkey 8, where it is also deprecated. Results are always
sorted by distance; see [GEOSEARCH](https://docs.hotkv.com/commands/geosearch/index.md).

## See also

[GEOSEARCH](https://docs.hotkv.com/commands/geosearch/index.md), [GEOSEARCHSTORE](https://docs.hotkv.com/commands/geosearchstore/index.md),
[GEORADIUSBYMEMBER_RO](https://docs.hotkv.com/commands/georadiusbymember_ro/index.md), [GEORADIUS](https://docs.hotkv.com/commands/georadius/index.md)