Node-redis: Zscan command gives issue

Created on 23 Oct 2015  路  3Comments  路  Source: NodeRedis/node-redis

Hi,

I want to use 'ZSCAN' command but it throws the following.

Error:
Redis Error { [Error: ERR syntax error] command: 'ZSCAN', code: 'ERR' }

Code:
connection.zscan(key , 0 , {match : value + "*"} , function(err,data){
if(err){
console.log("Redis Error",err);
return err;
}else
cb(null,data);
});

Please guide me as to the proper usage of this. Thanks.

question

Most helpful comment

@vabnirvana The following should work:

client.zscan(key, 0, 'MATCH', value + '*', callback);

The object notation is only supported for HGETALL.

All 3 comments

@vabnirvana The following should work:

client.zscan(key, 0, 'MATCH', value + '*', callback);

The object notation is only supported for HGETALL.

The result is ["0" , []] always empty array in all cases. Where as when i do the command in redis it gives me result.

I just wrote a test for it and it works as it should for me. Please check your key or pattern to really match your entries.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aletorrado picture aletorrado  路  6Comments

michaelwittig picture michaelwittig  路  3Comments

strumwolf picture strumwolf  路  4Comments

b96705008 picture b96705008  路  7Comments

shmendo picture shmendo  路  6Comments