ZLEXCOUNT
Syntax
ZLEXCOUNT key min max
Module
sortedsetCategories
read slow sortedsetDescription
Returns the number of elements in within the sorted set within the lexicographical range between min and max. Returns 0, if the keys does not exist or if all the members do not have the same score. If the value held at key is not a sorted set, an error is returned.
Examples
- Go (Embedded)
- CLI
Find the intersection between 2 sorted sets:
db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
count, err := vault.ZLexCount("key", "aa", "xx")
Find the intersection between 2 sorted sets:
> ZLEXCOUNT key aa xx