ZSCAN implemented.

This commit is contained in:
antirez 2013-10-28 11:36:42 +01:00
parent e50090aa06
commit 2c643ffa8d
3 changed files with 10 additions and 0 deletions

View File

@ -182,6 +182,7 @@ struct redisCommand redisCommandTable[] = {
{"zscore",zscoreCommand,3,"r",0,NULL,1,1,1,0,0},
{"zrank",zrankCommand,3,"r",0,NULL,1,1,1,0,0},
{"zrevrank",zrevrankCommand,3,"r",0,NULL,1,1,1,0,0},
{"zscan",zscanCommand,-3,"rR",0,NULL,1,1,1,0,0},
{"hset",hsetCommand,4,"wm",0,NULL,1,1,1,0,0},
{"hsetnx",hsetnxCommand,4,"wm",0,NULL,1,1,1,0,0},
{"hget",hgetCommand,3,"r",0,NULL,1,1,1,0,0},

View File

@ -1340,6 +1340,7 @@ void hlenCommand(redisClient *c);
void zremrangebyrankCommand(redisClient *c);
void zunionstoreCommand(redisClient *c);
void zinterstoreCommand(redisClient *c);
void zscanCommand(redisClient *c);
void hkeysCommand(redisClient *c);
void hvalsCommand(redisClient *c);
void hgetallCommand(redisClient *c);

View File

@ -2207,3 +2207,11 @@ void zrankCommand(redisClient *c) {
void zrevrankCommand(redisClient *c) {
zrankGenericCommand(c, 1);
}
void zscanCommand(redisClient *c) {
robj *o;
if ((o= lookupKeyReadOrReply(c,c->argv[1],shared.emptyscan)) == NULL ||
checkType(c,o,REDIS_ZSET)) return;
scanGenericCommand(c,o);
}