Redis 命令 - Hashs
HDEL key field [field ...]
Delete one or more hash fields
127.0.0.1:6379> HSET book.1 title helloworld
(integer) 0
127.0.0.1:6379> HEXISTS book.1 title
(integer) 1
127.0.0.1:6379> HDEL book.1 title
(integer) 1
127.0.0.1:6379> HEXISTS book.1 title
(integer) 0
More: http://redis.io/commands/hdel, http://www.redis.cn/commands/hdel.html
HEXISTS key field
Determine if a hash field exists
127.0.0.1:6379> HSET book.1 title helloworld
(integer) 1
127.0.0.1:6379> HEXISTS book.1 title
(integer) 1
127.0.0.1:6379> HEXISTS book.1 title2
(integer) 0
127.0.0.1:6379> HEXISTS book.2 title
(integer) 0
More: http://redis.io/commands/hexists, http://www.redis.cn/commands/hexists.html
HGET key field
Get the value of a hash field
127.0.0.1:6379> HSET book.1 title helloworld
(integer) 0
127.0.0.1:6379> HSET book.1 author Mr.404
(integer) 1
127.0.0.1:6379> HGET book.1 title
"helloworld"
127.0.0.1:6379> HGET book.1 author
"Mr.404"
More: http://redis.io/commands/hget, http://www.redis.cn/commands/hget.html
HGETALL key
Get all the fields and values in a hash
127.0.0.1:6379> HSET book.1 title helloworld
(integer) 1
127.0.0.1:6379> HSET book.1 author Mr.404
(integer) 1
127.0.0.1:6379> HGETALL book.1
1) "title"
2) "helloworld"
3) "author"
4) "Mr.404"
More: http://redis.io/commands/hgetall, http://www.redis.cn/commands/hgetall.html
HINCRBY key field increment
Increment the integer value of a hash field by the given number
127.0.0.1:6379> HSET book.1 price 30
(integer) 1
127.0.0.1:6379> HINCRBY book.1 price 10
(integer) 40
127.0.0.1:6379> HINCRBY book.1 price -5
(integer) 35
More: http://redis.io/commands/hincrby, http://www.redis.cn/commands/hincrby.html
HINCRBYFLOAT key field increment
Increment the float value of a hash field by the given amount
127.0.0.1:6379> HSET book.1 price 30
(integer) 0
127.0.0.1:6379> HINCRBYFLOAT book.1 price 9.99
"39.99"
127.0.0.1:6379> HINCRBYFLOAT book.1 price -4.5
"35.49"
More: http://redis.io/commands/hincrbyfloat, http://www.redis.cn/commands/hincrbyfloat.html
HKEYS key
Get all the fields in a hash
127.0.0.1:6379> HSET book.1 title helloworld
(integer) 0
127.0.0.1:6379> HSET book.1 author Mr.404
(integer) 0
127.0.0.1:6379> HKEYS book.1
1) "title"
2) "author"
More: http://redis.io/commands/hkeys, http://www.redis.cn/commands/hkeys.html
HLEN key
Get the number of fields in a hash
127.0.0.1:6379> HSET book.1 title helloworld
(integer) 0
127.0.0.1:6379> HSET book.1 author Mr.404
(integer) 0
127.0.0.1:6379> HLEN book.1
(integer) 2
More: http://redis.io/commands/hlen, http://www.redis.cn/commands/hlen.html
HMGET key field [field ...]
Get the values of all the given hash fields
127.0.0.1:6379> HSET book.1 title helloworld
(integer) 0
127.0.0.1:6379> HSET book.1 author Mr.404
(integer) 0
127.0.0.1:6379> HMGET book.1 author title
1) "Mr.404"
2) "helloworld
More: http://redis.io/commands/hmget, http://www.redis.cn/commands/hmget.html
HMSET key field value [field value ...]
Set multiple hash fields to multiple values
127.0.0.1:6379> HMSET book.1 title helloworld author Mr.404
OK
127.0.0.1:6379> HGET book.1 title
"helloworld"
127.0.0.1:6379> HGET book.1 author
"Mr.404"
More: http://redis.io/commands/hmset, http://www.redis.cn/commands/hmset.html
HSET key field value
Set the string value of a hash field
127.0.0.1:6379> HSET book.1 title helloworld
(integer) 0
127.0.0.1:6379> HSET book.1 author Mr.404
(integer) 1
127.0.0.1:6379> HGET book.1 title
"helloworld"
127.0.0.1:6379> HGET book.1 author
"Mr.404"
More: http://redis.io/commands/hset, http://www.redis.cn/commands/hset.html
HSETNX key field value
Set the value of a hash field, only if the field does not exist
127.0.0.1:6379> HSETNX book.1 title helloworld
(integer) 1
127.0.0.1:6379> HSETNX book.1 title hellopython
(integer) 0
127.0.0.1:6379> HGET book.1 title
"helloworld"
More: http://redis.io/commands/hsetnx, http://www.redis.cn/commands/hsetnx.html
HSTRLEN key field
Get the length of the value of a hash field
More: http://redis.io/commands/hstrlen
HVALS key
Get all the values in a hash
127.0.0.1:6379> HSETNX book.1 title helloworld
(integer) 0
127.0.0.1:6379> HSET book.1 author Mr.404
(integer) 1
127.0.0.1:6379> HVALS book.1
1) "helloworld"
2) "Mr.404"
More: http://redis.io/commands/hvals, http://www.redis.cn/commands/hvals.html
HSCAN key cursor [MATCH pattern] [COUNT count]
Incrementally iterate hash fields and associated values
More: http://redis.io/commands/hscan, http://www.redis.cn/commands/hscan.html
Redis 命令 - Hashs的更多相关文章
- redis命令大全
redis windows下使用及redis命令 Redis 是一个开源,高级的键值对的存储.它经常作为服务端的数据结构,它的键的数据类型能够是strings, hashs, lists, sets( ...
- Redis命令拾遗二(散列类型)
本文版权归博客园和作者吴双共同所有,欢迎转载,转载和爬虫请注明原文地址 :博客园蜗牛NoSql系列地址 http://www.cnblogs.com/tdws/tag/NoSql/ Redis命令拾 ...
- redis命令总结
Redis命令总结 redis 127.0.0.1:6379> info #查看server版本内存使用连接等信息 redis 127.0.0.1:6379> client list ...
- redis如何执行redis命令
Redis 命令 Redis 命令用于在 redis 服务上执行操作.所以我们必须要启动Redis服务程序,也就是redis安装目录下的redis-server.exe,你可以双击执行,也可以打开cm ...
- 常用 redis 命令(for php)
Redis 主要能存储 5 种数据结构,分别是 strings,hashes,lists,sets 以及 sorted sets. 新建一个 redis 数据库 $redis = new Redis( ...
- Redis命令大全&中文解释&在线测试命令工具&在线中文文档
在线测试命令地址:http://try.redis.io/ 官方文档:http://redis.io/commands http://redis.io/documentation Redis 命令参考 ...
- Redis命令
redis的常用命令主要分为两个方面.一个是键值相关命令.一个是服务器相关命令(redis-cli进入终端) 1.键值相关命令 keys * 取出当前所有的key exists name 查看n是否有 ...
- redis命令参考
http://doc.redisfans.com/ 进入redis命令行模式方式: 1.进入redis安装目录 2.运行redis-cli
- Redis 命令参考
Redis 命令参考 http://redis.readthedocs.org/en/latest/index.html
随机推荐
- Python魔术师--self
(原文是 Python's Magical Self ,来自 http://concentricsky.com ) Python的self参数有时真让人抓狂,比如,你必须在每一个类的方法里显示定义se ...
- Linux学习笔记----(2)
闲着无事,就敲起了Linux 命令,熟悉一下.记得昨天在书上看到了 find命令的用法,觉得挺神奇的. 其中 find 能够确定文件的查找深度 于是 敲了如下命令: #mkdir father #to ...
- PostgreSQL的 initdb 源代码分析之四
继续分析: if (pwprompt && pwfilename) { fprintf(stderr, _("%s: password prompt and password ...
- QM课程03-采购中的质量管理
QM模块被包含于采购过程的下列决策制定阶段:查询.供应商选择.采购订单.货物订单.收货.收到检查和收货数量的下达. 供应商下达 质量部门为一种被指定的物料下达一个供应商,它可以限制或限定下达的数量.如 ...
- Codeforces Gym 100513M M. Variable Shadowing 暴力
M. Variable Shadowing Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100513/ ...
- 也谈读书和书籍选择问题(C#)
前言 读到一篇.net程序员应该看什么书?深有感触.以前曾经用C#也开发过几年的东西.在那里对相关语言和开发都有了一定的了解.这里,结合自己当初的一些体会和见识把一些比较好的书籍也和大家分享一下.这一 ...
- GoldenGate配置(一)之单向复制配置
GoldenGate配置(一)之单向复制配置 环境: Item Source System Target System Platform Red Hat Enterprise Linux Server ...
- Linux用户及用户组设置
查看当前用户所属的组 groups 查看<user1>, <user2> 和 <user3>所属的组 groups <user1> <user2 ...
- rtp的封包与拆包h264
请看文档rfc3984 1.看h264的帧 SPS序列參数帧 00 00 00 01 67 64 . . .. PPS图像參数帧 00 00 00 01 68 EE... . I帧 00 00 00 ...
- HBuilder:最快的Web开发IDE
这里给大家介绍一个个人觉得最好用的web开发工具:Hbuilder. HBuilder是DCloud推出的一款支持HTML5的Web开发IDE.快,是HBuilder的最大优势,通过完整的语法提示和代 ...