| 1 |
import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands'; |
| 2 |
|
| 3 |
export const FIRST_KEY_INDEX = 1; |
| 4 |
|
| 5 |
export const IS_READ_ONLY = true; |
| 6 |
|
| 7 |
interface CursorReadOptions { |
| 8 |
COUNT?: number; |
| 9 |
} |
| 10 |
|
| 11 |
export function transformArguments( |
| 12 |
index: RedisCommandArgument, |
| 13 |
cursor: number, |
| 14 |
options?: CursorReadOptions |
| 15 |
): RedisCommandArguments { |
| 16 |
const args = [ |
| 17 |
'FT.CURSOR', |
| 18 |
'READ', |
| 19 |
index, |
| 20 |
cursor.toString() |
| 21 |
]; |
| 22 |
|
| 23 |
if (options?.COUNT) { |
| 24 |
args.push('COUNT', options.COUNT.toString()); |
| 25 |
} |
| 26 |
|
| 27 |
return args; |
| 28 |
} |
| 29 |
|
| 30 |
export { transformReply } from './AGGREGATE_WITHCURSOR'; |