ioredis module for Nest that supported cluster, sentinel mode.
$ npm i --save @pokeguys/nestjs-redis ioredis
# or
$ yarn add @pokeguys/nestjs-redis ioredis
// app.module.ts
@Module({
imports: [
RedisModule.forRoot({ uri: 'redis://localhost:6379/' }),
],
})
export class AppModule {}
// app.service.ts
@Injectable()
export class AppService {
constructor(@InjectRedis() private readonly redis: RedisClient) {}
}
you can find all the documentation here for the redis module.