Description
Returns the number of keys in the currently selected database.Method Signature
Parameters
This command takes no parameters.Return Value
The number of keys in the database
Examples
Get database size
Monitor database growth
Check if database is empty
Track deletes
Performance
DBSIZE is an O(1) operation - it returns the count instantly without scanning the keyspace.