1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00
Files
node-redis/packages/search/lib/commands/CURSOR_READ.ts
2024-09-29 13:19:06 +03:00

31 lines
636 B
TypeScript

import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
export const FIRST_KEY_INDEX = 1;
export const IS_READ_ONLY = true;
interface CursorReadOptions {
COUNT?: number;
}
export function transformArguments(
index: RedisCommandArgument,
cursor: number,
options?: CursorReadOptions
): RedisCommandArguments {
const args = [
'FT.CURSOR',
'READ',
index,
cursor.toString()
];
if (options?.COUNT) {
args.push('COUNT', options.COUNT.toString());
}
return args;
}
export { transformReply } from './AGGREGATE_WITHCURSOR';