String Commands
String commands are the most basic data type commands, which can store strings, integers, or floating-point numbers. Strings can store up to 512 MB of data.
Command List
APPEND
If the key already exists and is a string, appends the value to the end of the key
DECR
Decrements the numeric value stored in the key by one
DECRBY
Decrements the numeric value stored in the key by the specified value
GET
Gets the value of the specified key
GETRANGE
Returns a substring of the string value in the key
GETSET
Sets the value of the given key to a new value and returns the old value of the key
INCR
Increments the numeric value stored in the key by one
INCRBY
Increments the numeric value stored in the key by the specified value
INCRBYFLOAT
Increments the numeric value stored in the key by the specified float value
MGET
Gets the values of all given keys
MSET
Sets one or more key-value pairs simultaneously
SET
Sets the value of the specified key
STRLEN
Returns the length of the string value stored in the key
Use Cases
String commands are the most commonly used data type commands, suitable for various scenarios such as caching, counters, and distributed locks. Counter functionality can be easily implemented through INCR and DECR series commands.
For detailed usage and parameters of each command, please refer to the individual command documentation linked above.