GEOHASH
GEOHASH key member [member ...]
- Group
- Geospatial
- Complexity
- O(1) per member
- Arity
- -3 (at least 3 words, counting the command name)
- Flags
- read-only
- Keys
- first 1, last 1, step 1
- HotKV Cloud
- All plans
- On-Premise
- no license needed
GEOHASH returns, for each member, the standard geohash string of its stored
position. The strings are 11 characters long and work with any geohash tool or
site. Two strings that share a longer prefix are usually closer together.
The last character carries no precision and is always 0.
Return value
Section titled “Return value”| Case | RESP2 | RESP3 |
|---|---|---|
| Always | Array with one element per member: the geohash as a bulk string, or nil for a missing member | Array; missing members are null |
A missing key gives an array of nils. WRONGTYPE if the key is not a sorted
set.
Examples
Section titled “Examples”127.0.0.1:6379> GEOADD cities -0.1276 51.5072 london 2.3522 48.8566 paris(integer) 2127.0.0.1:6379> GEOHASH cities london paris atlantis1) "gcpvj0e54w0"2) "u09tvw0f640"3) (nil)Compatibility
Section titled “Compatibility”Same as Redis 7 and Valkey 8.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.