MCPcopy
hub / github.com/redis/node-redis / getNodeClientForKey

Method getNodeClientForKey

packages/client/lib/cluster/index.ts:769–771  ·  view source on GitHub ↗

* Returns the connected node client responsible for the given key's slot. * Useful for connection-level operations that the cluster client does not expose * directly, such as `WATCH` followed by `MULTI`/`EXEC`: * * ```javascript * const nodeClient = await cluster.getNodeClientForKey(k

(key: RedisArgument, isReadonly?: boolean)

Source from the content-addressed store, hash-verified

767 * @param isReadonly - If `true`, may return a replica client; otherwise returns the slot master.
768 */
769 getNodeClientForKey(key: RedisArgument, isReadonly?: boolean) {
770 return this._self._slots.getClientForKey(key, isReadonly);
771 }
772
773 /**
774 * @deprecated use `.masters` instead

Callers 1

index.spec.tsFile · 0.80

Calls 1

getClientForKeyMethod · 0.80

Tested by

no test coverage detected