diff --git a/packages/client/lib/client/index.ts b/packages/client/lib/client/index.ts index e6f1fef10e5..0caf90014e5 100644 --- a/packages/client/lib/client/index.ts +++ b/packages/client/lib/client/index.ts @@ -619,13 +619,15 @@ export default class RedisClient< return this.#isolationPool.use(fn); } - multi(): RedisClientMultiCommandType { + MULTI(): RedisClientMultiCommandType { return new (this as any).Multi( this.multiExecutor.bind(this), this.#options?.legacyMode ); } + multi = this.MULTI; + async multiExecutor( commands: Array, selectedDB?: number, diff --git a/packages/client/lib/cluster/index.ts b/packages/client/lib/cluster/index.ts index 57ec6ff7050..6eafdda86ce 100644 --- a/packages/client/lib/cluster/index.ts +++ b/packages/client/lib/cluster/index.ts @@ -224,7 +224,7 @@ export default class RedisCluster< } } - multi(routing?: RedisCommandArgument): RedisClusterMultiCommandType { + MULTI(routing?: RedisCommandArgument): RedisClusterMultiCommandType { return new this.#Multi( (commands: Array, firstKey?: RedisCommandArgument, chainId?: symbol) => { return this.#execute( @@ -237,6 +237,8 @@ export default class RedisCluster< ); } + multi = this.MULTI; + getMasters(): Array> { return this.#slots.getMasters(); }