article-no.07 Redis Getting Started Guide

Source: Internet
Author: User

1. Get the list of key names that match the rule:Keys wildcard

? : matches any one character

*: Matches any one (>=0) character

[]: Match any of the characters between parentheses, you can use "-" to denote a range

\x: Match escape character

2.exists key: Determine if a key exists

3, del key [Key1 Key2]: Delete key, return the number of deletions, >=1: Delete succeeded, 0: Delete failed or does not exist

4. Type key: The data type of the return key value

5, incr new_num: self-increase +1

Incrby New_num 10: self-increment +10

DECR new_num: Auto minus-1

Decrby new_num 10: Auto minus-10

Incrbyfloat New_num 2.7 Self-increment +2.7 floating point

Every time the latest value is returned, all Redis commands are atomic operations

6. Key naming rule: Object type: Object ID: Object property (user:1001:friends.list User ID 1001 buddy list)

7. Append key "Hello": Append value to tail, return total length

8. Strlen Key: Gets the total length of the string

9. Get or set multiple key values at the same time

127.0.0.1:6379[5]> mset AAA 111 BBB 222ok127.0.0.1:6379[5]> mget AAA bbb1) "111" 2) "222"


article-no.07 Redis Getting Started Guide

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.