Redis Beginner 2 String String

[Note]: Reprinted to Big Brother Zhige's document, only for learning, slightly deleted and added

[String string] The standard key-value form is mostly used to manage string integer floating point numbers

1. 	
SET key value associates the string value value to key . [with covering effect]
APPEND key value Append value to the end of the original value of key
GET key returns value / nil / error is not a String type, such as set ...

2. 	
MSET key value [key value ...] Sets one or more key-value pairs at the same time. Covering effect
MGET key [key ...] Returns all (one or more) values ​​for the given key. nil if key does not exist

3.	
SETNX key value Set the value of key to value if and only if key does not exist. (SET if Not eXists)
MSETNX key value [key value ...] Simultaneously set one or more key-value pairs, [if and only if none of the given keys exist]

4.	
SETEX key seconds value Associates the value value to key and sets the key's lifetime to seconds (in seconds).
PSETEX key milliseconds value Set the key's lifetime in milliseconds
STRLEN key Returns the length of the string value stored at key. STR string Len length


5. 	
INCR key Increments the numeric value stored in the key by one.
INCRBY key increment increment increment value
DECR key decrements the numeric value stored in the key by one.
DECRBY key decrement decrement decrement value
INCRBYFLOAT key increment is the value stored in the key plus the floating point increment increment [will go to 0, which is stored in a unified standard]


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324723786&siteId=291194637