1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00
Files
node-redis/packages/bloom/lib/commands/t-digest/CREATE.ts
2023-07-05 15:22:33 -04:00

21 lines
588 B
TypeScript

import { RedisArgument, SimpleStringReply, Command } from '@redis/client/dist/lib/RESP/types';
export interface TDigestCreateOptions {
COMPRESSION?: number;
}
export default {
FIRST_KEY_INDEX: 1,
IS_READ_ONLY: false,
transformArguments(key: RedisArgument, options?: TDigestCreateOptions) {
const args = ['TDIGEST.CREATE', key];
if (options?.COMPRESSION !== undefined) {
args.push('COMPRESSION', options.COMPRESSION.toString());
}
return args;
},
transformReply: undefined as unknown as () => SimpleStringReply<'OK'>
} as const satisfies Command;