You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
Add count
option to FT.CURSOR READ
(#2492)
* feat: Add count option to FT.CURSOR READ * Update CURSOR_READ.spec.ts --------- Co-authored-by: Leibale Eidelman <me@leibale.com>
This commit is contained in:
@@ -4,16 +4,27 @@ export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
export const IS_READ_ONLY = true;
|
||||
|
||||
interface CursorReadOptions {
|
||||
COUNT?: number;
|
||||
}
|
||||
|
||||
export function transformArguments(
|
||||
index: RedisCommandArgument,
|
||||
cursor: number
|
||||
cursor: number,
|
||||
options?: CursorReadOptions
|
||||
): RedisCommandArguments {
|
||||
return [
|
||||
const args = [
|
||||
'FT.CURSOR',
|
||||
'READ',
|
||||
index,
|
||||
cursor.toString()
|
||||
];
|
||||
|
||||
if (options?.COUNT) {
|
||||
args.push('COUNT', options.COUNT.toString());
|
||||
}
|
||||
|
||||
return args;
|
||||
}
|
||||
|
||||
export { transformReply } from './AGGREGATE_WITHCURSOR';
|
||||
|
Reference in New Issue
Block a user