You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-12-12 21:21:15 +03:00
22 lines
762 B
TypeScript
22 lines
762 B
TypeScript
import { CommandParser } from '@redis/client/dist/lib/client/parser';
|
|
import { RedisArgument, Command, NumberReply, UnwrapReply } from '@redis/client/dist/lib/RESP/types';
|
|
import AGGREGATE_WITHCURSOR from './AGGREGATE_WITHCURSOR';
|
|
|
|
export interface FtCursorReadOptions {
|
|
COUNT?: number;
|
|
}
|
|
|
|
export default {
|
|
NOT_KEYED_COMMAND: true,
|
|
IS_READ_ONLY: true,
|
|
parseCommand(parser: CommandParser, index: RedisArgument, cursor: UnwrapReply<NumberReply>, options?: FtCursorReadOptions) {
|
|
parser.push('FT.CURSOR', 'READ', index, cursor.toString());
|
|
|
|
if (options?.COUNT !== undefined) {
|
|
parser.push('COUNT', options.COUNT.toString());
|
|
}
|
|
},
|
|
transformReply: AGGREGATE_WITHCURSOR.transformReply,
|
|
unstableResp3: true
|
|
} as const satisfies Command;
|