加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

3.小功能大用处

发布时间:2020-12-16 01:43:12 所属栏目:安全 来源:网络整理
导读:标题 : 3.小功能大用处 目录 : Redis 序号 : 3 10) "students" 127.0.0.1:6379 ? ? ### GEO shell 添加地址位置信息 127.0.0.1:6379 geoadd cities:locations 116.28 39.55 beijing (integer) 1 添加已经存在的key,返回0 127.0.0.1:6379 geoadd cities:locat

标题 :
3.小功能大用处
目录 :
Redis
序号 :
3

10) "students"
127.0.0.1:6379>
? ? ### GEOshell

添加地址位置信息

127.0.0.1:6379> geoadd cities:locations 116.28 39.55 beijing
(integer) 1

添加已经存在的key,返回0

127.0.0.1:6379> geoadd cities:locations 116.28 39.55 beijing
(integer) 0

同时添加多个地理位置

127.0.0.1:6379> geoadd cities:locations 117.12 39.08 tianjin 114.29 38.02 shijiazhuang
(integer) 2

获取地理位置信息

127.0.0.1:6379> geopos cities:locations tianjin
1) 1) "117.12000042200088501"
2) "39.0800000535766543"
127.0.0.1:6379> geopos cities:locations beijing
1) 1) "116.28000229597091675"
2) "39.5500007245470826"

获取两个位置间的距离

m-米,km-公里,mi-英里,ft-尺

127.0.0.1:6379> geodist cities:locations tianjin beijing km
"89.2061"

获取执行位置范围内的地址信息位置集合

127.0.0.1:6379> georadiusbymember cities:location beijing 500 km
(empty list or set)
127.0.0.1:6379> georadiusbymember cities:location beijing 5000 km
(empty list or set)
127.0.0.1:6379> geohash cities:bejing
(empty list or set)
127.0.0.1:6379> geohash cities:beijing
(empty list or set)
127.0.0.1:6379> geohash cities:tianjin
(empty list or set)

获取geohash

127.0.0.1:6379> geohash cities:locations tianjin
1) "wwgq34k1tb0"
127.0.0.1:6379> zrem key cities:locations tianjin
(integer) 0

删除地址位置信息

127.0.0.1:6379> zrem cities:locations tianjin
(integer) 1
127.0.0.1:6379>
?
```

引用链接

https://www.runoob.com/redis/redis-hyperloglog.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读