You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
(docs) add jsdoc comments to command parsers (#2984)
* (docs) bloom: add jsdocs for all commands * (docs) json: add jsdocs * (docs) search: add jsdocs for all commands * (docs) jsdocs for std commands * (docs) jsdoc comments to time series commands
This commit is contained in:
@@ -4,6 +4,12 @@ import { RedisVariadicArgument } from '@redis/client/dist/lib/commands/generic-t
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: false,
|
||||
/**
|
||||
* Adds one or more items to a Top-K filter and returns items dropped from the top-K list
|
||||
* @param parser - The command parser
|
||||
* @param key - The name of the Top-K filter
|
||||
* @param items - One or more items to add to the filter
|
||||
*/
|
||||
parseCommand(parser: CommandParser, key: RedisArgument, items: RedisVariadicArgument) {
|
||||
parser.push('TOPK.ADD');
|
||||
parser.pushKey(key);
|
||||
|
@@ -4,6 +4,12 @@ import { RedisVariadicArgument } from '@redis/client/dist/lib/commands/generic-t
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: true,
|
||||
/**
|
||||
* Returns the count of occurrences for one or more items in a Top-K filter
|
||||
* @param parser - The command parser
|
||||
* @param key - The name of the Top-K filter
|
||||
* @param items - One or more items to get counts for
|
||||
*/
|
||||
parseCommand(parser: CommandParser, key: RedisArgument, items: RedisVariadicArgument) {
|
||||
parser.push('TOPK.COUNT');
|
||||
parser.pushKey(key);
|
||||
|
@@ -12,6 +12,12 @@ function pushIncrByItem(parser: CommandParser, { item, incrementBy }: TopKIncrBy
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: false,
|
||||
/**
|
||||
* Increases the score of one or more items in a Top-K filter by specified increments
|
||||
* @param parser - The command parser
|
||||
* @param key - The name of the Top-K filter
|
||||
* @param items - A single item or array of items to increment, each with an item name and increment value
|
||||
*/
|
||||
parseCommand(
|
||||
parser: CommandParser,
|
||||
key: RedisArgument,
|
||||
|
@@ -12,6 +12,11 @@ export type TopKInfoReplyMap = TuplesToMapReply<[
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: true,
|
||||
/**
|
||||
* Returns configuration and statistics of a Top-K filter, including k, width, depth, and decay parameters
|
||||
* @param parser - The command parser
|
||||
* @param key - The name of the Top-K filter to get information about
|
||||
*/
|
||||
parseCommand(parser: CommandParser, key: RedisArgument) {
|
||||
parser.push('TOPK.INFO');
|
||||
parser.pushKey(key);
|
||||
|
@@ -3,6 +3,11 @@ import { RedisArgument, ArrayReply, BlobStringReply, Command } from '@redis/clie
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: true,
|
||||
/**
|
||||
* Returns all items in a Top-K filter
|
||||
* @param parser - The command parser
|
||||
* @param key - The name of the Top-K filter
|
||||
*/
|
||||
parseCommand(parser: CommandParser, key: RedisArgument) {
|
||||
parser.push('TOPK.LIST');
|
||||
parser.pushKey(key);
|
||||
|
@@ -3,6 +3,11 @@ import { RedisArgument, ArrayReply, BlobStringReply, NumberReply, UnwrapReply, C
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: true,
|
||||
/**
|
||||
* Returns all items in a Top-K filter with their respective counts
|
||||
* @param parser - The command parser
|
||||
* @param key - The name of the Top-K filter
|
||||
*/
|
||||
parseCommand(parser: CommandParser, key: RedisArgument) {
|
||||
parser.push('TOPK.LIST');
|
||||
parser.pushKey(key);
|
||||
|
@@ -4,6 +4,12 @@ import { RedisVariadicArgument, transformBooleanArrayReply } from '@redis/client
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: false,
|
||||
/**
|
||||
* Checks if one or more items are in the Top-K list
|
||||
* @param parser - The command parser
|
||||
* @param key - The name of the Top-K filter
|
||||
* @param items - One or more items to check in the filter
|
||||
*/
|
||||
parseCommand(parser: CommandParser, key: RedisArgument, items: RedisVariadicArgument) {
|
||||
parser.push('TOPK.QUERY');
|
||||
parser.pushKey(key);
|
||||
|
@@ -9,6 +9,16 @@ export interface TopKReserveOptions {
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: false,
|
||||
/**
|
||||
* Creates a new Top-K filter with specified parameters
|
||||
* @param parser - The command parser
|
||||
* @param key - The name of the Top-K filter
|
||||
* @param topK - Number of top occurring items to keep
|
||||
* @param options - Optional parameters for filter configuration
|
||||
* @param options.width - Number of counters in each array
|
||||
* @param options.depth - Number of counter-arrays
|
||||
* @param options.decay - Counter decay factor
|
||||
*/
|
||||
parseCommand(parser: CommandParser, key: RedisArgument, topK: number, options?: TopKReserveOptions) {
|
||||
parser.push('TOPK.RESERVE');
|
||||
parser.pushKey(key);
|
||||
|
Reference in New Issue
Block a user