Commands
All data is accessible via String keys
Commands are atomic
Basic Commands
Sets value.
SET key valueReturns value.
GET keyRemoves a value.
DEL keyReturns value and then updates the key with a new value.
GETSET key valueSet value if it does not exist.
SETNX key valueThere are other commands that work for multiple values. They have M prefix. Just DEL works for multiple by default.
MSET
MGET
MSETNX
DELExpiration Commands
Expires key after given number of seconds.
Expire at given time.
Set value with a timestamp in a single statement.
Get expiration date.
Remove expiration time and keep the key persistent.
Other Commands
Increase value without retrieving it first. Good for counters.
Get part of a large string.
Last updated
Was this helpful?