Skip to content

Server Commands

ping

r.ping()    # True

info

r.info()             # all sections
r.info("memory")     # specific section

dbsize

r.dbsize()    # number of keys in current database

select

r.select(1)   # switch to database 1

flushdb / flushall

r.flushdb()    # delete all keys in current database
r.flushall()   # delete all keys in all databases

Danger

These commands are destructive and irreversible.

echo / time

r.echo("hello")     # 'hello'
r.time()             # [seconds, microseconds]

publish

r.publish("channel", "message")   # number of subscribers that received it

lastsave

r.lastsave()    # Unix timestamp of last successful save