await redis.zadd("key", 
    { score: 1, member: "one"}, 
    { score: 2, member: "two" },
);
const elements = await redis.zlexcount("key", "two", "+");
console.log(elements); // 1

Arguments

key
string
required

The key to get.

min
string
required

The lower lexicographical bound to filter by.

Use - to disable the lower bound.

max
string
required

The upper lexicographical bound to filter by.

Use + to disable the upper bound.

Response

The number of matched.

await redis.zadd("key", 
    { score: 1, member: "one"}, 
    { score: 2, member: "two" },
);
const elements = await redis.zlexcount("key", "two", "+");
console.log(elements); // 1