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.