【get√】发现一个redis zset的新玩法:用ZINTERSTORE把value都置0

直接上指令:
redis-cli -h 192.168.0.5 -p 6379 -a test123

DEL __temp_ahfu1  
ZADD __temp_ahfu1 1 0.0.18.185_0 2 0.0.35.118_0 3 0.0.40.230_0 4 0.0.45.28_0  5 0.0.49.69_0 6 0.0.51.77_0 7 0.0.62.150_0 8 0.0.62.249_1 9 0.0.76.43_0 10 0.0.9.77_1   #插入10个子key

ZRANGEBYSCORE __temp_ahfu1 -inf +inf withscores  #读出来看看

ZINTERSTORE __temp_ahfu1 1 __temp_ahfu1 WEIGHTS 0  #自己和自己取交集,然后值的权重乘以0

猜你喜欢

转载自www.cnblogs.com/ahfuzhang/p/12942860.html