Redis 3: string of storage type

Source: Internet
Author: User
1. single Value assignment: Set a 100 [Assign multiple values: mset a 100 B 200 C 300] 2. single value: Get a [multiple values: mget a B C] 3. the number incrementing by incr A is + 1 on the basis of a, that is, 101 is returned. If the pre-value is 0, 1 is returned. If the pre-value is not an integer, the error "is not an integer... 3.1 decimal decr usage as above decr4. Convention (naming method) object type: Object ID: Object Property User: 100: DS storage user list User: 100 with user ID 100: friends. count stores the number of friends in the friend list with a user ID of 100. add the specified integer incrby set a 100 incrby a 5 get a and return 1056. add the specified floating point number (Double Precision) incrbyfloat set a 100 incrbyfloat a 1.5 get A returns 101.5. 7. append the value to the end of a string (it is better to append it !) Set a li append a bin get a returns Libin 8. strlen gets the string length set a li strlen a returns 2 9. bit operation getbit A 3 get the value of a to convert to binary, what is the binary bit of the 3rd bits (either 0 or 1) setbit A 3 1: After converting the value of a to binary, set the binary bit of 3rd bits to 1 bitcount A to calculate the value of, bitcount a 0 1 The number of binary bits is 1. For example, if the value of a is "ABC ", then 0 1 is the number of bitop or res a bits of A and B in the binary value of "AB ". not
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.