Sorted Set
ZLEXCOUNT
Returns the number of elements in the sorted set stored at key filtered by lex.
Arguments
keybodystringrequired
The key to get.
minbodystringrequired
The lower lexicographical bound to filter by.
Use - to disable the lower bound.
maxbodystringrequired
The upper lexicographical bound to filter by.
Use + to disable the upper bound.
Response
integerrequired
The number of matched.
Example
await redis.zadd("key", { score: 1, member: "one"}, { score: 2, member: "two" },);const elements = await redis.zlexcount("key", "two", "+");console.log(elements); // 1