import redis # 导入redis 模块
pool = redis.ConnectionPool(host='localhost', port=16379, db=7, decode_responses=True)
r = redis.Redis(connection_pool=pool)
r.hset("collection", "test", "test_value")
print(r.hget('collection', "test"))

import redis # 导入redis 模块
pool = redis.ConnectionPool(host='localhost', port=16379, db=7, decode_responses=True)
r = redis.Redis(connection_pool=pool)
r.hset("collection", "test", "test_value")
print(r.hget('collection', "test"))