nestjs-redis icon indicating copy to clipboard operation
nestjs-redis copied to clipboard

Connection does not select the database index

Open MoacirCarlos opened this issue 6 months ago • 0 comments

Expected Behavior

I need to connect my application to a cluster used by other systems, so I need to write to another redis index.

Current Behavior

I pass the db parameter with the value 10, but it always keeps writing at index 0.

Possible Solution

N/A

Steps to Reproduce (for bugs)

You can use the connection example below.

Context

Select the redis cluster index in the connection.

Your Environment

ClusterModule.forRoot({
  readyLog: true,
  config: {
    nodes: [
      //`redis://${process.env.REDIS_HOST}:${process.env.REDIS_PORT}/${process.env.REDIS_DB}`,  // another try
      {
        host: process.env.REDIS_HOST,
        port: parseInt(process.env.REDIS_PORT),
      },
    ],
    redisOptions: {
      db: parseInt(process.env.REDIS_DB),
      password: process.env.REDIS_PASSWORD,
      keyPrefix: process.env.REDIS_PREFIX,
    },
  },
})
  • Version used: 10
  • NestJS version: > 10
  • Node.js version: 20
  • Operating System and version (macOS, Windows, Linux): Docker/Linux
  • Link to your project: N/A

MoacirCarlos avatar Aug 18 '24 14:08 MoacirCarlos