Skip to main content
Documentation
API Reference
Search
⌘K
Ask AI
⌘I
Discord
Blog
Twitter
Console
Redis
/
/
SDKs
/
Typescript
/
Commands
/
Server
DBSIZE
Count the number of keys in the database.
1 min read
Copy as Markdown
Arguments
#
This command has no arguments
Response
#
SCRIPT LOAD
FLUSHALL
Example
const
keys
=
await
redis.
dbsize
();
console.
log
(keys)
// 20