title: node_redis ZRANGEBYLEX returns "ERR min or max not valid string range item" error
body: <p>Solved. Solution is below, thanks to @hobbs, I corrected it.</p>
  
  <p>I'm using <a href="https://github.com/NodeRedis/node_redis" rel="nofollow">node_redis</a> package.</p>
  
  <p>Here's how I use ZRANGEBYLEX command via cli.</p>
  
  <pre><code>127.0.0.1:6379&gt; zadd movie 0 "Creed:2015:id1"
  (integer) 1
  127.0.0.1:6379&gt; zadd movie 0 "Secret in Their Eyes:2015:id2"
  (integer) 1
  127.0.0.1:6379&gt; zadd movie 0 "Spotlight:2015:id3"
  (integer) 1
  127.0.0.1:6379&gt; zadd movie 0 "The Lobster:2015:id4"
  (integer) 1
  127.0.0.1:6379&gt; zadd movie 0 "The Corpse of Anna Fritz:2015:id5"
  (integer) 1
  127.0.0.1:6379&gt; zadd movie 0 "The Martian:2015:id6"
  (integer) 1
  127.0.0.1:6379&gt; zadd movie 0 "The Revenant:2015:id7"
  (integer) 1
  127.0.0.1:6379&gt; zadd movie 0 "Steve Jobs:2015:id8"
  (integer) 1
  </code></pre>
  
  <p>Getting all movies that start with "The" word.</p>
  
  <pre><code>127.0.0.1:6379&gt; zrangebylex movie "[The" "(The\xff"
  1) "The Corpse of Anna Fritz:2015:id5"
  2) "The Lobster:2015:id4"
  3) "The Martian:2015:id6"
  4) "The Revenant:2015:id7"
  </code></pre>
  
  <p>So far, so good.</p>
  
  <p>First 2 items.</p>
  
  <pre><code>zrangebylex movie "[The" "(The\xff" limit 0 2
  1) "The Corpse of Anna Fritz:2015:id5"
  2) "The Lobster:2015:id4"
  </code></pre>
  
  <p>Here's my attempt to do the same thing with Node.js, but I get an error.</p>
  
  <pre><code>var redis = require("redis");
  var client = redis.createClient();
  
  app.get('/redis', function(req, res) {
    var args2 = ["movie", "The", "The", 'LIMIT', 0, 2];
    client.zrangebylex(args2, function(err, response) {
      if (err) throw err;
      console.log(response);
    });
  });
  </code></pre>
  
  <p>Here's the full error log.</p>
  
  <pre><code>Error: ERR min or max not valid string range item
  www-0     at Error (native)
  www-0     at HiredisReplyParser.return_data (/Users/me/Desktop/project/node_modules/redis/lib/parsers/hiredis.js:14:28)
  www-0     at HiredisReplyParser.execute (/Users/me/Desktop/project/node_modules/redis/lib/parsers/hiredis.js:24:22)
  www-0     at Socket.&lt;anonymous&gt; (/Users/me/Desktop/project/node_modules/redis/index.js:131:27)
  www-0     at emitOne (events.js:77:13)
  www-0     at Socket.emit (events.js:169:7)
  www-0     at readableAddChunk (_stream_readable.js:146:16)
  www-0     at Socket.Readable.push (_stream_readable.js:110:10)
  www-0     at TCP.onread (net.js:523:20)
  </code></pre>
  
  <p>SOLUTION</p>
  
  <pre><code>app.get('/redis', function(req, res) {
    var args2 = ["movie", "[The", '(The\xff', 'LIMIT', "0", "2"];
    client.zrangebylex(args2, function(err, response) {
      if (err) throw err;
      console.log(response);
      res.end();
    });
  });
  </code></pre>