In my node.js script, I have an array of strings, and I want LPUSH these strings in a Redis queue. I tried:
var redis = require('redis').createClient(); redis.lpush('queue', ['1', '2', '3'])
which results in a single line being pressed:
redis 127.0.0.1:6379> lrange queue 0 -1 1) "1,2,3"
Redis supports multiple values ββin the LPUSH , I am looking for help using this function. I am not asking how to iterate over my array and push each element separately. :)
EDIT:
I know if I do this:
redis.lpush('queue', '1', '2', '3')
I get what I expect, but in my real application, the array is generated at runtime, and I don't know its contents.
source share