redis lrem 问题

pool = redis.ConnectionPool(host='localhost', port=6379, decode_responses=True)
r = redis.Redis(connection_pool=pool)

r.lrem('key', 1, 'value') # 删除链表 key 中的 value 元素 (错误)
r.lrem('key', 'value', 1) # 删除链表 key 中的 value 元素 (正确)

# linux 学习
 ctrl+a : 移到行首(a是首字母); ctrl+e : 移到行尾(end);
useradd name # 创建用户
passwd name # 修改用户名
 ps -ef | grep redis  # 查看进程
 netstat -tunpl | grep 6379 # 查看端口


posted @ 2018-02-11 16:20  in_the_way  阅读(293)  评论(0编辑  收藏  举报