append name 2222
strlen name
Article views, likes can be used This realization.
incr agedecr age
Note that this must be a number to proceed, so a key is reset.
The String type can store not only strings but also numbers.
If you want to bring the step size:
incrby age 5decrby age 8
getrange name 1 3
getrange name 0 -1View all, similar to the string interception operation in python.
setrange name 0 test
setex mykey 60 redis
setnx mykey redis333
mset k1 v1 k2 v2 k3 v3mget, get multiple at one time.
mget k1 k2 k3
msetnx k1 v1 k4 v4
{name: pingguo, age:22}set it to a
user1, you can do this:
mset user:1:name pingguo user:1:age 22mget user:1:name user:1:agemset user:1:name pingguo user:1:age 22 mget user:1:name user:1:age
If the value does not exist, return
nil. If it exists, get the original value and set the new value.
getset db mongodb
The above is the detailed content of What are the common operation commands for Redis's basic data type String?. For more information, please follow other related articles on the PHP Chinese website!