I have recently started developing a project with PHP
and Redis
(predis
). We can see all databases and their keys by running INFO keyspace
command in redis-cli. I want to know how I can get database names and their keys count with predis
and PHP
. There is dbsize()
function in predis
, but it returns keys of a selected DB not all databases;
Asked
Active
Viewed 367 times
0

Hoda Kh
- 357
- 3
- 19
1 Answers
2
I found it :)
info()
function can be used for my purpose. It returns the databases and their keys in an associative array.

Hoda Kh
- 357
- 3
- 19