String of redis study notes

String is the simplest data type in redis. A key corresponds to a value, which is stored in binary and can contain any data, jpg or serialized objects.

1.set key value to set the object to the corresponding value

 

2.get key to get the value of the corresponding key

 

3.setnx key value exists the key setting is unsuccessful

 

4.setex key time value set the time-sensitive key 

 

5.setrange key n value will replace the third character of the existing key with value

 

6.mset key1 value1 key2 value2 set multiple key values

 

7.msetnx set multiple non-existing keys at a time

 

8.getset key value returns the old value of the key and sets the new value of the key

 

9.getrange key 0 5 Get the first 5 strings of the key

 

10.mget key1 key2 key3 batch get the value of key

 

11. incr key increments the key value by 1 decr key decrements by 1

 

12.Incrby key n Increase the key by n if the key does not exist, the default key is 0

 

13.append key value  追加 value

 

14.strlen key returns the length of the value

 

 

 

 

 

 

 

 

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327043195&siteId=291194637