Redis-hash type operation

Source: Internet
Author: User

Hash type operation
Set Operation:
Hset:hset Key filed value creates a Filed-value name value pair for the specified key
Hsetnx:hsetnx Key filed value creates a Filed-value name value pair that does not exist, the creation fails
Hmset:hmset key filed1 value1 filed2 value2 Create multiple filed-value corresponding to key
Hdel:hdel Key filed Delete the Filed-value name value pair for the specified key

Query operation:
hget:    hget Key filed             Gets the value of the filed of the specified key
hmget:    hmget key filed1 filed2 filed3    Gets the value of filed1, Filed2, filed3 corresponding to the specified key
hkeys:    hkeys filed             get all filed
hvals:    hvals filed     for the specified key         gets all the value of the specified key
hgetall:    hgetall filed             gets all Filed-value name values for the specified key to the
hexists:     Hexists Key filed            checks if the specified key exists
Hlen:     Hlen key                 Gets the number of filed for the specified key

Atomic operation:
Hincrby:hincrby key Filednum to the specified key filed plus the specified num

Redis-hash type operation

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.