-
-
Notifications
You must be signed in to change notification settings - Fork 96
Common commands
Alexandr Topilski edited this page May 23, 2019
·
15 revisions
-
SET - Set the value of a key, example:
SET test value
-
GET - Get the value of a key, example:
GET test
-
GETUNI - Get the value of a key, works for all key types, example:
GETUNI test
-
TYPE - Get type of key, example:
TYPE test
-
DEL - Delete key, example:
DEL test
-
RENAME - Rename a key, example:
RENAME test test2
-
DBKCOUNT - Return the number of keys in the selected database, example:
DBKCOUNT
-
KEYS - Find all keys matching the given limits, example:
KEYS a z 100
(for Redis/Pika/Dynomite/KeyDB:KEYS *
) -
SCAN - Incrementally iterate the keys space, example:
SCAN 0
-
FLUSHDB - Remove all keys from the current database, example:
FLUSHDB
-
INFO - Server information, example:
INFO <section or nothing>
-
HELP - Server information, example:
HELP <command or nothing>
-
DUMPTOJSON - Save database into json file, example:
DUMPTOJSON 0 PATH ~/1.json
-
DUMPTOCSV - Save database into csv file, example:
DUMPTOCSV 0 PATH ~/1.csv
-
DUMPTOFILE - Store value of key into file, example:
DUMPTOFILE test PATH ~/test
SET test value
=> OK
GET test
=> value
RENAME test test2
=> OK
GET test2
=> value
SET test3 value3
=> OK
GET test3
=> value3
DBKCOUNT
=> 2
KEYS a z 100
=> test2\ntest3
SCAN 0
=> test2\ntest3
DEL test2
=> 1
FLUSHDB
=> OK