Redis Dbsize command
Redis Dbsize command returns the current number of key database.
grammar
redis DBSIZE basic command syntax is as follows:
redis 127.0.0.1:6379> DBSIZE
Available versions
> = 1.0.0
return value
The key number of the current database.
Examples
redis 127.0.0.1:6379> DBSIZE (integer) 5 redis 127.0.0.1:6379> SET new_key "hello_moto" # 增加一个 key 试试 OK redis 127.0.0.1:6379> DBSIZE (integer) 6