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.

GEOPOS

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

GEOPOS returns the stored position of each member as a longitude and a latitude. Positions are stored with a precision of well under a meter, so the values read back differ slightly from the ones given to GEOADD.

Case RESP2 RESP3
Member exists Array [longitude, latitude] of bulk strings Array [longitude, latitude] of doubles
Member or key missing Nil array in its place Null in its place

WRONGTYPE if the key is not a sorted set.

127.0.0.1:6379> GEOADD cities -0.1276 51.5072 london
(integer) 1
127.0.0.1:6379> GEOPOS cities london atlantis
1) 1) "-0.12760072946548462"
2) "51.50720053692976"
2) (nil)

Same as Redis 7 and Valkey 8.

GEOADD, GEODIST, GEOHASH