string¶
string can be use to cache three types of values.
Byte string values
Integer values
Floating-point values
The maximum size limit for a string value is 512MB
incr/decr commands¶
assume non-existent or empty string having a value of zero:
incr key: increase the value of key by 1desc key: decrease the value of key by 1incrby key intval: increase the value of key by intvaldescby key intval: decrease the value of key by intvalincrbyfloat key val: increase the value of key by val
substring commands¶
append key val: concatenate value to string stored at the given keygetrange key start end-incl: get substring from start to end inclusivesetrange key offset val: append value to stored string ended before offsetgetbit key idx: get bit value at idxsetbit key idx val: set bit value at idxbitcount key [start, end]: count the bits in the sub/stringbitop op des-key key-name [key-name2 ...]: bitwise operations,AND,OR,XOR, orNOT, on provided strings, storing result in destination key