TOPK.LIST
TOPK.LIST key [WITHCOUNT]
- Available in:
- Redis Open Source / Bloom 2.0.0
- Time complexity:
- O(k) where k is the value of top-k
- ACL categories:
-
@topk,@read,@slow, - Compatibility:
- Redis Enterprise and Redis Cloud compatibility
Return the full list of items in Top-K sketch.
Parameters
- key: the name of the sketch.
- WITHCOUNT: the count of each element is also returned.
Examples
TOPK.LIST topk
1) foo
2) 42
3) bar
TOPK.LIST topk WITHCOUNT
1) foo
2) (integer) 12
3) 42
4) (integer) 7
5) bar
6) (integer) 2
Redis Enterprise and Redis Cloud compatibility
| Redis Enterprise |
Redis Cloud |
Notes |
|---|---|---|
| ✅ Supported |
✅ Flexible & Annual ✅ Free & Fixed |
Return information
k (or less) items in the given Top-k sketch. The list is sorted by decreased count estimation.
One of the following:
- Array of bulk string replies representing the names of items in the given sketch. If
WITHCOUNTis requested, an array of bulk string reply and integer reply pairs, representing the names of the items in the sketch together with their counts. - Simple error reply in these cases: invalid arguments, non-existant key, or key of the incorrect type.