Skip to content


How do I apply optional parameters to methods? #391

shubik opened this Issue · 2 comments

2 participants


Hi Matt,
How do can I apply optional params, e.g.

ZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count]

I need to use count because otherwise it returns thousands of results? Or should I apply limit to results already in my code?


You just add the parameters you need as inputs to the zrangebyscore method:

var r = require("redis").createClient();

r.zadd("myzset", 1, "one");
r.zadd("myzset", 1, "uno");
r.zadd("myzset", 2, "two");

r.zrangebyscore("myzset", "-inf", "+inf", "limit", 0, 2, function (err, replies) {
    console.log(replies);  // [ 'one', 'uno' ]
@brycebaril brycebaril closed this


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.