Latest web development tutorials

คำสั่ง Redis Hvals

Redis กัญชา (กัญชา)

Redis Hvals คำสั่งส่งคืนค่าตารางแฮชทุกสาขา

ไวยากรณ์

Redis Hvals ไวยากรณ์คำสั่งพื้นฐานจะเป็นดังนี้:

redis 127.0.0.1:6379> HVALS KEY_NAME FIELD VALUE 

รุ่นที่มีจำหน่าย

> = 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> HVALS myhash
1) "foo"
2) "bar"

# 空哈希表/不存在的key

redis 127.0.0.1:6379> EXISTS not_exists
(integer) 0

redis 127.0.0.1:6379> HVALS not_exists
(empty list or set)

Redis กัญชา (กัญชา)