Nosql-& gt; redis learning data type, nosql-redis

Source: Internet
Author: User

Nosql> redis learning data type, nosql-redis
Redis-> string binary setnx name lijie judge whether the key value exists. If there is a returned value, 0 does not exist. Set it to setex. Specify the key value validity period. setex name 10 lijie setrange: Set the vlaue value of the specified key. sub-string (we prefer to replace the 126 mailbox with the gmail mailbox) setrange name 6 (character subscript) gmial.com note that the length of the character mset is set to the value of multiple keys at a time. Successfully, all values of the OK Mark are returned, failed to return 0 flag no value set getset set key value, and return the string of the vlaue value of the key obtained from the old value getrange. For example, set a baoweijun getrange 0 5. Return baowei mget to obtain the value of multiple keys at a time. If the corresponding key does not exist, the corresponding nil is returned. incr adds key values, and return the new value incrb. Y sets the key when adding a specified value key like incr does not exist and thinks that the original value is 0. decr performs the subtraction operation on the value of the key. returns the length of the new string value. strlen is used to obtain the length of the value of the specified key. hashes type redi-> hash is a string type field and value ing. table, and the delete operation is 0 (1 ). Hash is suitable for storing objects. It is equivalent to dividing each field of an object into the string type, and storing one degree downstream in the hash type consumes less memory, in addition, you can easily access the entire object hsetnx and set hashfield to the specified value. If the key does not exist, create it first, if there are multiple filed values with the same hash value of 0 hmset returned, hget will get the touch character of the table. The short word "hmet" will be returned in batch. hincrby will add a given value to the specified hash filed.

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.