We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 448ac9d commit 0f7ae93Copy full SHA for 0f7ae93
examples/topk.js
@@ -66,6 +66,24 @@ async function topK() {
66
// ]
67
console.log(top10);
68
69
+ // List out the top 10 with their counts (requires RedisBloom >=2.2.9)
70
+ const top10WithCounts = await client.topK.listWithCount('mytopk');
71
+ console.log('The top 10 with counts:');
72
+ console.log(top10WithCounts);
73
+ // top10WithCounts looks like this:
74
+ // [
75
+ // { item: 'suze', count: 42363 },
76
+ // { item: 'lance', count: 41982 },
77
+ // { item: 'simon', count: 41831 },
78
+ // { item: 'steve', count: 39237 },
79
+ // { item: 'guy', count: 39078 },
80
+ // { item: 'kyleb', count: 37338 },
81
+ // { item: 'leibale', count: 34230 },
82
+ // { item: 'kyleo', count: 33812 },
83
+ // { item: 'alex', count: 33679 },
84
+ // { item: 'nava', count: 32663 }
85
+ // ]
86
+
87
// Check if a few team members are in the top 10 with TOPK.QUERY:
88
const [ steve, suze, leibale, frederick ] = await client.topK.query('mytopk', [
89
'steve',
0 commit comments