13

I can use Redis.rpush('key', 1, 2, 3) to push three elements to redis, but if there is a sequence:

seq = [1, 2, 3]

Redis.rpush('key', seq)

It will push a 'seq' element to redis but not the three number. Is there any way I can push the whole sequence to redis?

eumiro
  • 207,213
  • 34
  • 299
  • 261
magicyang
  • 453
  • 1
  • 5
  • 14

1 Answers1

26

You can use this:

Redis.rpush('key', *seq)

More at SO.

Community
  • 1
  • 1
eumiro
  • 207,213
  • 34
  • 299
  • 261