redis的简单使用(哈希)

版权声明:转载的话 请标明出处 https://blog.csdn.net/qq_28198181/article/details/84861217

最近学习redis的使用  

本文记录的是redis中哈希表的常用命令:

存储Hash

String key  和 String value 的map容器

每一个Hash 可以存储4294967295个键值对

存储Hash 常用命令:

赋值,取值,删除,增加数字,自学命令

1.赋值

hset hashname keys value

扫描二维码关注公众号,回复: 4650546 查看本文章

2.取值

hget hashname  keys

3.改写keys的value 如果 没有就新添加key

hmset hashname  keys value

4.查看hashname中所有的key和value

hgetall hashname

5.删除 这个key和value

hdel hashname key 

6.删除整个hash表

del hashname 

7.查看hashname 中是否存在这个key

hexists hashname key

8.查看共多少个key和value对

hlen myhash

9.列出myhash中所有key

hkeys myhash

10.hvals myhash

列出myhash中所有value

猜你喜欢

转载自blog.csdn.net/qq_28198181/article/details/84861217
今日推荐