Latest web development tutorials

RedisのDBSIZEコマンド

Redisのサーバー

RedisのDBSIZEコマンドが鍵データベースの現在の数を返します。

文法

次のようにRedisのDBSIZE基本的なコマンドの構文は次のとおりです。

redis 127.0.0.1:6379> DBSIZE

利用可能なバージョン

> = 1.0.0

戻り値

現在のデータベースのキー番号。

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

Redisのサーバー