Node-redis: How could I execute 'CLIENT SETNAME' ?

Created on 21 Jun 2017  路  1Comment  路  Source: NodeRedis/node-redis

  • Version: 2.7.1
  • Platform: Node.js 6.950 on Windows 7 x64
  • Description: I could't found a appropriate way to execute 'CLIENT SETNAME' command.
    Code: client.send_command('CLIENT SETNAME', ['test'], function (err, res) {
    console.log(arguments);
    });
    It will be error:
    { '0':
    { ReplyError: ERR unknown command 'CLIENT SETNAME'
    at parseError (D:\Documents\H5\Chatnode_modules\redis-parserlib\parser.js:193:12)
    at parseType (D:\Documents\H5\Chatnode_modules\redis-parserlib\parser.js:303:14) command: 'CLIENT SETNAME', args: [ 'test' ], code: 'ERR' },
    '1': undefined }
question

Most helpful comment

Hi @lasting0001 the correct syntax would be

client.send_command('CLIENT', ['SETNAME', 'test'], function(err, res) {
  console.log(arguments);
});

or simply

client.client('SETNAME', 'test', function(err, res) {
  console.log(arguments);
});

>All comments

Hi @lasting0001 the correct syntax would be

client.send_command('CLIENT', ['SETNAME', 'test'], function(err, res) {
  console.log(arguments);
});

or simply

client.client('SETNAME', 'test', function(err, res) {
  console.log(arguments);
});
Was this page helpful?
0 / 5 - 0 ratings

Related issues

twappworld picture twappworld  路  7Comments

gpascale picture gpascale  路  4Comments

shmendo picture shmendo  路  6Comments

Mickael-van-der-Beek picture Mickael-van-der-Beek  路  6Comments

abhaygarg picture abhaygarg  路  5Comments