我可以通过以下方式使用 Python 从 Redis 获取一个键/值:import redisr = redis.StrictRedis(host='localhost', port=6379, db=0)data = r.get('12345')如何同时从例如 2 个键中获取值(通过一次调用)?我试过:data = r.get('12345', '54321')但这不起作用..另外如何根据部分键获取所有值?例如data = r.get('123*')
2 回答

慕侠2389804
TA贡献1719条经验 获得超6个赞
from django_redis import get_redis_connection
r = get_redis_connection()
data = r.keys('123*')
现在工作。
添加回答
举报
0/150
提交
取消