Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Python的Redis中哈希字段的增量值_Python_Redis_Redis Py - Fatal编程技术网

使用Python的Redis中哈希字段的增量值

使用Python的Redis中哈希字段的增量值,python,redis,redis-py,Python,Redis,Redis Py,我在python中的redis中创建了一个散列,如下所示: r.hmset('list:123', {'name': 'john', 'count': 5}) 如何增加键列表:123的count值 r.hincrby("list:123", "count", 1) 请参考本页 请参考本页 我认为重点不在于覆盖已经存在的内容。更多的是读写操作,比如hincrby。我认为重点不是覆盖已经存在的内容。更多的是读写操作,比如hincrby。 hash = '

我在python中的redis中创建了一个
散列
,如下所示:

r.hmset('list:123', {'name': 'john', 'count': 5})
如何增加键
列表:123的count值

r.hincrby("list:123", "count", 1)
请参考本页

请参考本页


我认为重点不在于覆盖已经存在的内容。更多的是读写操作,比如hincrby。我认为重点不是覆盖已经存在的内容。更多的是读写操作,比如hincrby。
hash = 'list:123'
key = 'count'
n = 1

r.hincrby(hash, key, n)