如何从redis geohash中删除项目?

Ada*_*tan 5 hash geo redis redis-3.2

Redis 3.2 具有 geohash 类型。

GEOADD 用于添加键:

> GEOADD restaurants 32.0 34.0 Falafel
(integer) 1
> GEOADD restaurants 32.1 34.1 Pizza
(integer) 1
Run Code Online (Sandbox Code Playgroud)

GEORADIUS 用于进行地理查询:

> GEORADIUS restaurants 32.05 34.05 100 km WITHDIST
1) 1) "Falafel"
   2) "7.2230"
2) 1) "Pizza"
   2) "7.2213"
Run Code Online (Sandbox Code Playgroud)

但是,HDEL似乎不起作用:

> HDEL restaurants Falafel
(error) WRONGTYPE Operation against a key holding the wrong kind of value
Run Code Online (Sandbox Code Playgroud)

如何删除或设置地理散列中的键的 TTL?

Ada*_*tan 9

Geohashes 是排序集,所以正确的命令是ZREM

> ZREM restaurants Falafel
(integer) 1

> GEORADIUS restaurants 32.05 34.05 100 km WITHDIST
1) 1) "Pizza"
   2) "7.2213"
Run Code Online (Sandbox Code Playgroud)