Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
到目前为止,我只能为集合中的每个元素检索一个哈希字段。是否有直接或间接的方法来检索集合中每个元素的所有哈希值和字段?我不知道哈希中的所有键,因此 SORT 命令之后的多个 GET 命令将不起作用。
这就是我的工作:
我正在寻找这样的东西:
对于当前的 Redis 版本 (2.6.14),仅使用一个命令是不可能做到这一点的。
您可以做的是获取列表的所有值,然后为每个值迭代调用 HGETALL:
LRANGE user:100:venuePointers 0 -1 for each value: HGETALL hashKey