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.

GEOHASH

Last updated
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.

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.

127.0.0.1:6379> GEOADD cities -0.1276 51.5072 london 2.3522 48.8566 paris
(integer) 2
127.0.0.1:6379> GEOHASH cities london paris atlantis
1) "gcpvj0e54w0"
2) "u09tvw0f640"
3) (nil)

Same as Redis 7 and Valkey 8.

GEOADD, GEOPOS