Redis data type Operations (ii)--hash

Source: Internet
Author: User

1. Hset

Format: Hset ' name ' key ' value '

Add a named Name object that contains Key-value key-value pairs.


2. Hget

Format: Hget ' name ' key '

Gets the value that is named the name object key.


3. Hsetnx

Format: hsetnx ' name ' key ' value '

Add a name to the object. If name already exists, neither add nor modify the original value, and return 0, if it does not exist, add and return 1.


4. Hmset

Format: Hmset ' name ' ' Key1 ' value1 ' key2 ' value2 ' ...

Add an object named name, which adds multiple Key-value key-value pairs.


5. Hmget

Format: Hmget ' name ' ' Key1 ' value1 ' key2 ' value2 ' ...

Gets the value of multiple keys named name object.


6. Hincrby

Format: Hincrby ' name ' key ' ±{num}

The value of the key named name object is incremented by num, does not exist, and is automatically initialized to 0 if NUM is negative.


7. hexists

Format: hexists ' name ' key '

Determine if a key named name is present.


8. Hlen

Format: Hlen ' name '

Gets the number of keys called the name object.


9. Hdel

Format: Hdel ' name ' ' key1 ' key2 ' ...

Deletes a Key-value key-value pair named the name object.


Ten. Hkeys

Format: Hkeys ' name '

Gets the name of all keys named the name object.


Hvals.

Format: hvals ' name '

Gets all value values that are named name objects.


Hgetall.

Format: Hgetall ' name '

Gets all the Key-value values that are named the name object.


This article is from the "Bronze Gong" blog, please be sure to keep this source http://jaeger.blog.51cto.com/11064196/1772252

Redis data type Operations (ii)--hash

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.