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

RedisClient.zrangebyscore method | Bun module | Bun

RedisClient.zrangebyscore method | Bun module | BunBuildDocsReferenceGuidesBlogDiscord/Bun/RedisClient/zrangebyscoreMzrangebyscore

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/Bun/RedisClient/zrangebyscoreMzrangebyscore

method

RedisClient.zrangebyscorezrangebyscore(key: KeyLike,min: string | number,max: string | number): Promisestring[]>;

Return members in a sorted set with scores within a given range

Returns all the elements in the sorted set at key with a score between min and max (inclusive by default). The elements are considered to be ordered from low to high scores.

Score ranges support:

-inf and +inf for negative and positive infinity( prefix for exclusive bounds (e.g., (5 means greater than 5, not including 5)
@param key

The sorted set key

@param min

Minimum score (can be "-inf", a number, or prefixed with "(" for exclusive)

@param max

Maximum score (can be "+inf", a number, or prefixed with "(" for exclusive)

@returns

Promise that resolves with array of members

await redis.send("ZADD", ["myzset", "1", "one", "2", "two", "3", "three"]);
const members = await redis.zrangebyscore("myzset", 1, 2);
// Returns: ["one", "two"]
zrangebyscore(key: KeyLike,min: string | number,max: string | number,withscores: 'WITHSCORES'): Promise[string, number][]>;

Return members in a sorted set with scores within a given range, with scores

@param key

The sorted set key

@param min

Minimum score

@param max

Maximum score

@param withscores

The "WITHSCORES" keyword to return scores along with members

@returns

Promise that resolves with array of [member, score, member, score, ...]

await redis.send("ZADD", ["myzset", "1", "one", "2", "two", "3", "three"]);
const result = await redis.zrangebyscore("myzset", 1, 2, "WITHSCORES");
// Returns: ["one", "1", "two", "2"]
zrangebyscore(key: KeyLike,min: string | number,max: string | number,limit: 'LIMIT',offset: number,count: number): Promisestring[]>;

Return members in a sorted set with scores within a given range, with pagination

@param key

The sorted set key

@param min

Minimum score

@param max

Maximum score

@param limit

The "LIMIT" keyword

@param offset

The number of elements to skip

@param count

The maximum number of elements to return

@returns

Promise that resolves with array of members

await redis.send("ZADD", ["myzset", "1", "one", "2", "two", "3", "three", "4", "four"]);
const result = await redis.zrangebyscore("myzset", "-inf", "+inf", "LIMIT", 1, 2);
// Returns: ["two", "three"]
zrangebyscore(key: KeyLike,min: string | number,max: string | number,withscores: 'WITHSCORES',...options: string | number[]): Promise[string, number][]>;

Return members in a sorted set with scores within a given range, with the score values

@param key

The sorted set key

@param min

Minimum score

@param max

Maximum score

@param options

Additional options (WITHSCORES, LIMIT offset count)

@returns

Promise that resolves with array of members (and scores if WITHSCORES is used)

zrangebyscore(key: KeyLike,min: string | number,max: string | number,withscores: 'WITHSCORES',limit: 'LIMIT',offset: number,count: number,...options: string | number[]): Promise[string, number][]>;

Return members in a sorted set with scores within a given range, with the score values

@param key

The sorted set key

@param min

Minimum score

@param max

Maximum score

@param options

Additional options (WITHSCORES, LIMIT offset count)

@returns

Promise that resolves with array of members (and scores if WITHSCORES is used)

zrangebyscore(key: KeyLike,min: string | number,max: string | number,...options: string | number[]): Promisestring[]>;

Return members in a sorted set with scores within a given range, with various options

@param key

The sorted set key

@param min

Minimum score

@param max

Maximum score

@param options

Additional options (WITHSCORES, LIMIT offset count)

@returns

Promise that resolves with array of members (and scores if WITHSCORES is used)

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.zrangebyscore method | Bun module | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    API documentation for method bun.RedisClient.zrangebyscore | Bun