You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
some commands
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import { ArrayReply, BlobStringReply, Command } from '../RESP/types';
|
||||
import { RedisVariadicArgument, pushVariadicArgument } from './generic-transformers';
|
||||
import { ZKeys, pushZKeysArguments } from './generic-transformers';
|
||||
|
||||
export interface ZUnionOptions {
|
||||
WEIGHTS?: Array<number>;
|
||||
AGGREGATE?: 'SUM' | 'MIN' | 'MAX';
|
||||
}
|
||||
|
||||
@@ -10,14 +9,10 @@ export default {
|
||||
FIRST_KEY_INDEX: 2,
|
||||
IS_READ_ONLY: true,
|
||||
transformArguments(
|
||||
keys: RedisVariadicArgument,
|
||||
keys: ZKeys,
|
||||
options?: ZUnionOptions
|
||||
) {
|
||||
const args = pushVariadicArgument(['ZUNION'], keys);
|
||||
|
||||
if (options?.WEIGHTS) {
|
||||
args.push('WEIGHTS', ...options.WEIGHTS.map(weight => weight.toString()));
|
||||
}
|
||||
const args = pushZKeysArguments(['ZUNION'], keys);
|
||||
|
||||
if (options?.AGGREGATE) {
|
||||
args.push('AGGREGATE', options.AGGREGATE);
|
||||
|
Reference in New Issue
Block a user