Nestjs Redis Packages - v10
    Preparing search index...

    Interface RedisClusterOptions<M, F, S, RESP, TYPE_MAPPING>

    interface RedisClusterOptions<
        M extends RedisModules = RedisModules,
        F extends RedisFunctions = RedisFunctions,
        S extends RedisScripts = RedisScripts,
        RESP extends RespVersions = RespVersions,
        TYPE_MAPPING extends TypeMapping = TypeMapping,
    > {
        clientSideCache?: ClientSideCacheConfig | PooledClientSideCacheProvider;
        commandOptions?: ClusterCommandOptions<TYPE_MAPPING>;
        defaults?: Partial<RedisClusterClientOptions>;
        functions?: F;
        maxCommandRedirections?: number;
        minimizeConnections?: boolean;
        modules?: M;
        nodeAddressMap?: NodeAddressMap;
        RESP?: RESP;
        rootNodes: RedisClusterClientOptions[];
        scripts?: S;
        unstableResp3?: boolean;
        useReplicas?: boolean;
    }

    Type Parameters

    • M extends RedisModules = RedisModules
    • F extends RedisFunctions = RedisFunctions
    • S extends RedisScripts = RedisScripts
    • RESP extends RespVersions = RespVersions
    • TYPE_MAPPING extends TypeMapping = TypeMapping

    Hierarchy

    Index

    Properties

    clientSideCache?: ClientSideCacheConfig | PooledClientSideCacheProvider

    Client Side Caching configuration for the pool.

    Enables Redis Servers and Clients to work together to cache results from commands sent to a server. The server will notify the client when cached results are no longer valid. In pooled mode, the cache is shared across all clients in the pool.

    Note: Client Side Caching is only supported with RESP3.

    const client = createCluster({
    clientSideCache: {
    ttl: 0,
    maxEntries: 0,
    evictPolicy: "LRU"
    },
    minimum: 5
    });
    const cache = new BasicPooledClientSideCache({
    ttl: 0,
    maxEntries: 0,
    evictPolicy: "LRU"
    });
    const client = createCluster({
    clientSideCache: cache,
    minimum: 5
    });
    commandOptions?: ClusterCommandOptions<TYPE_MAPPING>
    defaults?: Partial<RedisClusterClientOptions>

    Default values used for every client in the cluster. Use this to specify global values, for example: ACL credentials, timeouts, TLS configuration etc.

    functions?: F
    maxCommandRedirections?: number

    The maximum number of times a command will be redirected due to MOVED or ASK errors.

    minimizeConnections?: boolean

    When true, .connect() will only discover the cluster topology, without actually connecting to all the nodes. Useful for short-term or PubSub-only connections.

    modules?: M
    nodeAddressMap?: NodeAddressMap

    Mapping between the addresses in the cluster (see CLUSTER SHARDS) and the addresses the client should connect to Useful when the cluster is running on another network

    RESP?: RESP

    Specifies the Redis Serialization Protocol version to use. RESP2 is the default (value 2), while RESP3 (value 3) provides additional data types and features introduced in Redis 6.0.

    rootNodes: RedisClusterClientOptions[]

    Should contain details for some of the cluster nodes that the client will use to discover the "cluster topology". We recommend including details for at least 3 nodes here.

    scripts?: S
    unstableResp3?: boolean

    When set to true, enables commands that have unstable RESP3 implementations. When using RESP3 protocol, commands marked as having unstable RESP3 support will throw an error unless this flag is explicitly set to true. This primarily affects modules like Redis Search where response formats in RESP3 mode may change in future versions.

    useReplicas?: boolean

    When true, distribute load by executing readonly commands (such as GET, GEOSEARCH, etc.) across all cluster nodes. When false, only use master nodes.