Because I want to use lrange
command of Redis, I try to use the document type list
of Redis.
e.g.
rpush myl "1"
rpush myl "2"
lrange myl 0 -1
and we get
1) "1"
2) "2"
My problem is that sometimes I want to set a whole new list rather than set single element 1-by-1(like command lset
).
Is it possible to set my list use command like
setl myl ["1", "2", "3"]
lrange myl 0 -1
and get
1) "1"
2) "2"
3) "3"
(Override previous list)
DEL
the list, then reinsert.