Redis Operation Hash Test

Source: Internet
Author: User

1>hset setname field value hset stuset name zhangsan:1      2>hget setname field Hge T stuset name:nil hget stuset Name:zhangsan (indicates Redis is case-sensitive)  3>hsetnx setname field value If field exists, do nothing. If not, create hsetnx stuset name lisi:0 hsetnx stuset name lisi1:1 hget stuset name:zhangsan hget stuset NAME1:LISI 4&G T;hmset setname field1value1 field2 value2 ... hmset stuset namea a nameb b:ok hmset stuset Namea a nameb b Namec C:ok (thus    See, Hmset regardless of existence or not, will be assigned to enter)  5>hmget setname field1 field2 ... hmget stuset name name1 name2:1) Zhangsan 2) Lisi 3) nil 6>hexists determine if a field exists in Set hexsits setname field hexists stuset name1:1 hexists stuset Name2:0 7>hl  En view set number of fields Hlen setname hlen stuset:5 (field name name1 Namea nameb Namec)   8>hdel Delete field Hdel setname field Hdel stuset namec:1 Hdel stuset namec:0  9>hkeys View all fields of Set Hkeys setname hkeys stuname:1) name 2) name 1 3) Namea 4) NAMEB &NBsp;10>hvals View all valuehvals in set SetName hvals stuset:1) Zhangsan 2) Lisi 3) A 4) B  11>hgetall     Get set all field Valuehgetall setname  hgetall stuset:1) name 2) Zhangsan 3) name1 4) Lisi 5) Namea 6) A 7) Nameb 8) B 12>hincrby for field +xhincrby setname field x

Redis Operation Hash Test

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.