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.

TAG.COUNT

Last updated
TAG.COUNT key
Group
Tags
Complexity
O(1)
Arity
2 (exactly, counting the command name)
Flags
read-only, fast
Keys
first 1, last 1, step 1
HotKV Cloud
All plans
On-Premise
no license needed

TAG.COUNT returns how many tags are attached to key.

Case RESP2 RESP3
Always Integer: the number of tags (0 when none, or no such key) Integer
127.0.0.1:6379> SET article:1 "..."
OK
127.0.0.1:6379> TAG.SET article:1 news sports europe
(integer) 3
127.0.0.1:6379> TAG.COUNT article:1
(integer) 3
127.0.0.1:6379> TAG.COUNT article:2
(integer) 0

HotKV-only command.

TAG.GET, TAG.SET, TAG.EXISTS