Home > AI > Database > Redis >

redis-cli

You can type redis-cli to set the data.

$ redis-cli

Following are the commands.

commanddescriptionresult
flushallclear all data
set {key} {value}set one value
get {key}get one value
exists {key}see the key if exists
incr {key}If the value is interger, increase it
decr {key}if the value is integer, decrease it
set {scheme:name} {value}
get {scheme:name}
set {key} {value}
expire {key} {seconds}
ttl {key}see how many seconds left
setex {key} {seconds} {value}set the value with expiration seconds

Leave a Reply