redis store list
An introduction to Redis data types and abstractions – Redis
“
LPUSH mylist a # now the list is “a” LPUSH mylist b # now the list is “b”,”a” RPUSH mylist c # now the list is “b”,”a”,”c” (RPUSH was used this time) |
”
-》可以用list
LPUSH和RPUSH去保存数据到list
但是其所支持的操作中:
却没有希望的:
DELETE之类的命令,可以直接删除list中的某个元素
redis list delete single item
remove element from list by it index – Google Groups
提到了LSET
redis LSET
【总结】
终于找到了:
Redis中的SET集合,可以方便的SADD(=set add)存入和SREM(=set remove)删除单个元素
转载请注明:在路上 » 【已解决】redis中如何用列表保存数据+从列表中删除一个元素