Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

OBJECT REFCOUNT

Last updated
OBJECT REFCOUNT key
Group
Keys
Complexity
O(1)
Arity
3 (exactly, counting the command name)
HotKV Cloud
All plans
On-Premise
no license needed

OBJECT REFCOUNT exists for compatibility with tools that call it. The reply for an existing key is always 1.

Case RESP2 RESP3
The key exists Integer 1 Integer 1
The key does not exist Nil bulk string Null
127.0.0.1:6379> SET answer 42
OK
127.0.0.1:6379> OBJECT REFCOUNT answer
(integer) 1
127.0.0.1:6379> OBJECT REFCOUNT missing
(nil)

HotKV always replies 1 for an existing key.

OBJECT, OBJECT ENCODING