华夏棋牌

目录 搜索
Cluster cluster addslots(集群 槽位) cluster count failure reports(集群计数掉落败申报) cluster countkeysinslot cluster delslots cluster failover cluster forget cluster getkeysinslot cluster info cluster keyslot(集群键槽) cluster meet cluster nodes(集群节点) cluster replicate(集群复制) cluster reset(集群重置) cluster saveconfig cluster set config epoch cluster setslot cluster slaves cluster slots readonly readwrite Connection auth echo ping quit select swapdb Geo geoadd geodist geohash geopos georadius georadiusbymember Hashes hdel hexists hget hgetall hincrby hincrbyfloat hkeys hlen hmget hmset hscan hset hsetnx hstrlen hvals HyperLogLog pfadd pfcount pfmerge Keys del dump exists expire expireat keys migrate move object persist pexpire pexpireat pttl randomkey rename renamenx restore scan sort touch ttl type unlink wait Lists blpop brpop brpoplpush lindex linsert llen lpop lpush lpushx lrange lrem lset ltrim rpop rpoplpush rpush rpushx Pub/Sub psubscribe publish pubsub punsubscribe subscribe unsubscribe Scripting eval evalsha script debug script exists script flush script kill script load Server bgrewriteaof bgsave client getname client kill client list client pause client reply client setname command command count command getkeys command info config get config resetstat config rewrite config set dbsize debug object debug segfault flushall flushdb info lastsave monitor role save shutdown slaveof slowlog time Sets sadd scard sdiff sdiffstore sinter sinterstore sismember smembers smove spop srandmember srem sscan sunion sunionstore Sorted Sets zadd zcard zcount zincrby zinterstore zlexcount zrange zrangebylex zrangebyscore zrank zrem zremrangebylex zremrangebyrank zremrangebyscore zrevrange zrevrangebylex zrevrangebyscore zrevrank zscan zscore zunionstore Strings append bitcount bitfield bitop bitpos decr decrby get getbit getrange getset incr incrby incrbyfloat mget mset msetnx psetex set setbit setex setnx setrange strlen Transactions discard exec multi unwatch watch
文字

ZINTERSTORE destination numkeys key [key ...] [WEIGHTS weight [weight ...]] [AGGREGATE SUM|MIN|MAX]

自2.0.0起可用。

时间严重年夜度:华夏棋牌 O(N * K)+ O(M * log(M))最坏的情形,N 是最小的输入排序荟萃,K 是输入排序荟萃的数目,M 是效果排序荟萃中的元素数目。

盘算numkeys由指定键给出的已排序荟萃的交集,并将效果存储在中destinationnumkeys华夏棋牌在转达输入键和其他(可选)参数之前,必须供应输入键()的数目。

默许情形下,元素的效果得分是其存在的有序荟萃中的得分总和。由于交集须要一个元素成为每个给定的有序荟萃的成员,以是这招致效果荟萃中的每个元素的得分即是输入的有序荟萃的数目。

有关WEIGHTSAGGREGATE选项的诠释,请参阅 ZUNIONSTORE 。

假定destination华夏棋牌曾经存在,它将被笼罩。

前往值

整数回复:在destination取得的排序集中的元素数。

例子

redis>  ZADD zset1 1 "one" (integer) 1 

redis>  ZADD zset1 2 "two" (integer) 1 

redis>  ZADD zset2 1 "one" (integer) 1 

redis>  ZADD zset2 2 "two" (integer) 1 

redis>  ZADD zset2 3 "three" (integer) 1 

redis>  ZINTERSTORE out 2 zset1 zset2 WEIGHTS 2 3 (integer) 2 

redis>  ZRANGE out 0 -1 WITHSCORES 1) "one" 2) "5" 3) "two" 4) "10"

上一篇: 下一篇: