温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/bun/RedisClient/zinterstore
点击访问原文链接

RedisClient.zinterstore method | Bun module | Bun

RedisClient.zinterstore method | Bun module | BunBuildDocsReferenceGuidesBlogDiscord/Bun/RedisClient/zinterstoreMzinterstore

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/Bun/RedisClient/zinterstoreMzinterstore

method

RedisClient.zinterstorezinterstore(destination: KeyLike,numkeys: number,...args: string | number[]): Promisenumber>;

Compute the intersection of multiple sorted sets and store in destination

This command is similar to ZINTER, but instead of returning the result, it stores it in the destination key. If the destination key already exists, it is overwritten.

Options:

WEIGHTS: Multiply the score of each member in the corresponding sorted set by the given weight before aggregationAGGREGATE SUM|MIN|MAX: Specify how the scores are aggregated (default: SUM)
@param destination

The destination key to store the result

@param numkeys

The number of input keys (sorted sets)

@returns

Promise that resolves with the number of elements in the resulting sorted set

// Set up sorted sets
await redis.zadd("zset1", "1", "a", "2", "b", "3", "c");
await redis.zadd("zset2", "1", "b", "2", "c", "3", "d");

// Basic intersection store
const count1 = await redis.zinterstore("out", 2, "zset1", "zset2");
// Returns: 2 (stored "b" and "c" in "out")

// With weights
const count2 = await redis.zinterstore("out2", 2, "zset1", "zset2", "WEIGHTS", "2", "3");
// Returns: 2

// With MAX aggregation
const count3 = await redis.zinterstore("out3", 2, "zset1", "zset2", "AGGREGATE", "MAX");
// Returns: 2 (stores maximum scores)
Referenced typestype KeyLike = string | ArrayBufferView | Blob

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicense

Baked with ❤️ in San Francisco

We're hiring →

RedisClient.zinterstore method | Bun module | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    API documentation for method bun.RedisClient.zinterstore | Bun