Key-Value REPL Commands

The following commands are available via the REPL client.

Notes:

  1. The expires keyword indicates that a key is temporary.

  2. The key name doesn’t have to be quoted string, but must be if any spaces or certain special characters are a part of the key name.

  3. The key value must be a quoted string if specified in the REPL.

 

Key-based Data Commands

 

Get

Syntax:

get <key-name>;

Examples:

get key:name:1;
get "key name 1";

 

Set

Syntax:

set <key-name> "<key-value>";

Note: the key value must be a quoted string.

Examples:

set key:name:1 "test value";
set "key name 1" "test value";

 

Del

Syntax:

del <key-name>;

Examples:

del key:name:1;
del "key name 1";

 

Other Key Commands

 

Keys

Get the list of keys that have been set, optionally those that match the given key name pattern.

keys <pattern>

Pattern: key name pattern (optional).

Examples:

keys my_key_name;
keys my_key_nam_;
keys my%name;

 

Truncate

Truncate the keys:

truncate keys;