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.

CMS.QUERY

Last updated
CMS.QUERY key item [item ...]
Group
Count-min sketch
Complexity
O(n * depth), n being the items
Arity
-1 (at least 1 words, counting the command name)
Flags
none
Keys
first 1, last 1, step 1
HotKV Cloud
All plans
On-Premise
no license needed

CMS.QUERY returns the estimated count of each item in the Count-min sketch at key. An estimate is never below the item’s true count, and can be above it. Items never counted usually report 0.

An array with one integer per item, the same in RESP2 and RESP3.

Error replies: CMS: key does not exist, and WRONGTYPE if the key holds another type.

127.0.0.1:6379> CMS.INITBYDIM pageviews 2000 5
OK
127.0.0.1:6379> CMS.INCRBY pageviews /home 5 /pricing 1
1) (integer) 5
2) (integer) 1
127.0.0.1:6379> CMS.QUERY pageviews /home /pricing /blog
1) (integer) 5
2) (integer) 1
3) (integer) 0

Same as CMS.QUERY in RedisBloom.

CMS.INCRBY, CMS.INFO, CMS.MERGE