Lists get condensed into a comma-separated string on retrieval
Here's what I see in a node session:
logger = function(err, results) { console.log(JSON.stringify({err: err, results:results})); } [Function] r.rpush("abc", ["foo", "bar"], logger) true {"err":null,"results":1} r.lrange("abc", 0, -1, logger) true {"err":null,"results":["foo,bar"]}
Notice that results are ["foo, bar"] instead of ["foo", "bar"]. This seems like a bug of some sort - certainly not what I expected.
My package.json has: "redis": "0.8.x", "hiredis": "0.1.x",
Hi @stickfigure Yes, right now there is no type-sniffing for these sorts of operations. See my comment here on a similar case: https://github.com/mranney/node_redis/issues/369#issuecomment-13050944
It seems a common enough desire to pass data like this but my gut feeling is there are potentially real performance issues with implementations. I'll work on something here.
Thanks, I will use send_command directly for now. This really was a big surprise, and produced subtle hard-to-hunt-down behavior in my app. I'm sure a lot of people will stumble over the same problem. I'd rather have "safe" behavior than micro-optimized behavior; perhaps the speed demons can use send_command directly and the other apis can be more convenient?
Either way, thanks for maintaining this code.
Also, it may be wise to add a caution about this issue to the documentation - it would probably save a lot of aggregate man-hours of debugging.
yes, it took me one day to reach here.
Spent a few hours tonight scratching my head over this---almost sent it to production without realizing what was happening. +1 to better documentation about this issue. Again, though, thank you for your work on the client.
Not fixed => reopening
This got closed by #838