OBJECT REFCOUNT · Valkey

OBJECT REFCOUNT

Returns the reference count of a value of a key.

Usage

OBJECT REFCOUNT key

This command returns the reference count of the stored at <key>.

Reply RESP2

One of the following:

Integer reply: the number of references.

Nil reply: if key doesn’t exist.

Reply RESP3

One of the following:

Integer reply: the number of references.

Null reply: if key doesn’t exist.

Complexity

O(1)

ACL Categories

@keyspace @read @slow

History

See also

COPY, DEL, DUMP, EXISTS, EXPIRE, EXPIREAT, EXPIRETIME, KEYS, MIGRATE, MOVE, OBJECT, OBJECT ENCODING, OBJECT FREQ, OBJECT HELP, OBJECT IDLETIME, PERSIST, PEXPIRE, PEXPIREAT, PEXPIRETIME, PTTL, RANDOMKEY, RENAME, RENAMENX, RESTORE, SCAN, SORT, SORT_RO, TOUCH, TTL, TYPE, UNLINK, WAIT, WAITAOF.