redis-cli EXISTS user:1

Category: Databases & SQL

redis-cli EXISTS user:1

Check whether a key exists

Returns 1 when the key is present and 0 otherwise; EXISTS user:1 user:2 counts how many exist. Related: TYPE shows the value's data type.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.