请先看最后的纠正说明,谢谢
以前从来没有用过redis,现在有个任务需要使用redis,要求是能够根据index来删除key所对应的value list里面的值
def lrem(self, name, count, value):
"""
Remove the first ``count`` occurrences of elements equal to ``value``
from the list stored at ``name``.
The count argument influences the operation in the following ways:
count > 0: Remove elements equal to value moving from head to tail.
count < 0: Remove elements equal to value moving from tail to head.
count = 0: Remove all elements equal to value.
"""
return self.execute_command('LREM', name, count, value)
API 来自:redis-py client s