topkAdd method
TOPK.ADD key item item ...
Adds one or more items to the TopK data structure.
Returns a list of elements dropped from the TopK list.
Null indicates no drop.
Implementation
Future<List<String?>> topkAdd(
String key,
List<String> items, {
bool forceRun = false,
}) async {
await checkValkeySupport('TOPK.ADD', forceRun: forceRun);
final result = await execute(['TOPK.ADD', key, ...items]);
if (result is List) {
return result.map((e) => e?.toString()).toList();
}
return [];
}