我一直在使用 redis-cli 来了解 redis 的工作原理。我知道使用这个工具我可以做到这一点:
127.0.0.1:6379> set post:1:title "Redis is cool!"
OK
127.0.0.1:6379> set post:1:author "haye321"
OK
127.0.0.1:6379> get post:1:title
"Redis is cool!"
我似乎无法弄清楚如何使用 redis-py 来实现这一点。提供的命令似乎set
不允许对象类型或 ID。谢谢你的帮助。