DBSIZE
Counts keys in the selected database.
Keys & expiration · Example verified
Syntax covered here
DBSIZEThe cases check a populated database and verify a zero count after FLUSHDB and FLUSHALL.
Tested example & replies
Requests below run in order against an empty database. Each connection authenticates with the fixture password first. Quoted values are strings; null is a nil reply; arrays preserve RESP order.
# connection: default
> SET sample value
"OK"
# connection: default
> DBSIZE
1