Skip to content

client.duplicate(options) with options.db does not work #1281

@peecky

Description

@peecky
  • Version: node_redis: 2.8.0, redis-server: 3.2.9
  • Platform: Node.js 6.11.1
  • Description: When duplicating a client object via existing one with different DB option, the new one's DB is same to previous one's DB.
const redis = require('redis');
const redis1 = redis.createClient({ db: 1 }); // use DB 1. OK
const redis2 = redis1.duplicate({ db: 2 }); // use DB 1, not DB 2

I think that this code line is related to this issue.
https://github.com/NodeRedis/node_redis/blob/009479537eb920d2c34045026a55d31febd1edd7/lib/extendedApi.js#L98

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions