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

Stono picture Stono  ·  6Comments

Atala picture Atala  ·  3Comments

aletorrado picture aletorrado  ·  6Comments

twappworld picture twappworld  ·  7Comments

abhaygarg picture abhaygarg  ·  5Comments