我有2套结构,添加了以下值:
r.sadd("clONE", 'abc')
r.sadd("clONE", 'def')
r.sadd("clONE", 'ghi')
r.sadd("TWO", 'abc')
r.sadd("TWO", 'def')
print(r.sinter("clONE", "TWO"))
OUTPUT: set(['abc', 'def'])
如何使用pyredis从SET()中获取值“abc”和“def”?我试图通过指定数组索引[0]来使用数组语法,但得到以下错误
^{pr2}$
Tags:
集合没有索引。顺序取决于内部哈希。 不要依赖集合中的顺序,即使它看起来合乎逻辑。在
您可以执行以下操作:
或者
^{pr2}$相关问题 更多 >
编程相关推荐