content/commands/topk.add.md
Adds an item to a Top-k sketch. Multiple items can be added at the same time. If an item enters the Top-K sketch, the item that is expelled (if any) is returned. This allows dynamic heavy-hitter detection of items being entered or expelled from Top-K sketch.
redis> TOPK.ADD topk foo bar 42
1) (nil)
2) baz
3) (nil)
| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Supported</span> | <span title="Supported"><nobr>✅ Flexible & Annual</nobr></span> <span title="Supported">✅ Free & Fixed</nobr></span> | |
{{< multitabs id="topk-add-return-info" tab1="RESP2" tab2="RESP3" >}}
One of the following:
-tab-sep-
One of the following:
{{< /multitabs >}}