Redis Hmget 命令

Redis 教程 · 2019-03-07 10:42:16

Redis Hmget 命令用于返回哈希表中,一个或多个给定字段的值。

如果指定的字段不存在于哈希表,那么返回一个 nil 值。

语法

redis Hmget 命令基本语法如下:

redis 127.0.0.1:6379> HMGET KEY_NAME FIELD1...FIELDN 

可用版本

>= 2.0.0

返回值

一个包含多个给定字段关联值的表,表值的排列顺序和指定字段的请求顺序一样。

实例

redis 127.0.0.1:6379> HSET myhash field1 "foo"
(integer) 1
redis 127.0.0.1:6379> HSET myhash field2 "bar"
(integer) 1
redis 127.0.0.1:6379> HMGET myhash field1 field2 nofield
1) "foo"
2) "bar"
3) (nil)

点击查看所有 Redis 教程 文章: https://www.codercto.com/courses/l/33.html

查看所有标签

The Science of Programming

The Science of Programming

David Gries / Springer / 1989-4-21 / USD 99.00

Describes basic programming principles and their step-by- step applications.Numerous examples are included.一起来看看 《The Science of Programming》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具