The basic operation of redis string type

string type:

  • Add and modify data
mset key1 value1 key2 value2 [.....]
  • retrieve data
mget key1 key2 key3[....]

Insert picture description here

  • Get character size
strlen key

Insert picture description here

  • Append information to the back of the original information
append key value

Insert picture description here

  • Set the data to increase the value of the specified range
incr key
incrby key increment
incrbyfloat key increment

Insert picture description here

  • Set the data value to reduce the value of the specified range
decr key
decrby key incrment

Insert picture description here

Extended operations on String data

Set the data to have a specified life cycle

powershell setex key seconds value

Insert picture description here

powershell psetex key milliseconds value

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_44763595/article/details/110293894