GEOPOS
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.
Return value
Section titled “Return value”| 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.
Examples
Section titled “Examples”127.0.0.1:6379> GEOADD cities -0.1276 51.5072 london(integer) 1127.0.0.1:6379> GEOPOS cities london atlantis1) 1) "-0.12760072946548462" 2) "51.50720053692976"2) (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.