Basic commands
These are the basic key value commands.
PING
Check if the server is alive.
Example
> PING
PONG
GET <key>
Get the value of a key.
Example
# Exists
> GET foo
bar
# Doesn't exist
> GET bar
SET <key> <value>
Set the value of a key.
Example
> SET foo bar
bar
> SET another 123
123
> SET user:1:name John Doe
John Doe
SETNX <key> <value>
Set the value of a key only if it doesn't exist.
Example
> SET test hi
hi
> SETNX test hello
0
> SETNX secondtest bye
1
> GET secondtest
bye
DEL <key>
Delete a key.
Example
> DEL foo
foo
Last updated on April 25, 2023