Shuffle a small list in Redis DB

Question:

i need to shuffle a small list (100 elements) in my Redis DB with Python.

Or is it easier to do the shuffling locally and then save it to the DB?

Is it possible?

Asked By: EliaTolin

||

Answers:

There is no Redis list command to shuffle the order, so you’ll need to shuffle it using Python (likely you can use the random.shuffle method) and then store that shuffled list in Redis.

Answered By: Savannah Norem
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.