Add scored members to a sorted set.
Example:
let added ← client.zAdd "scores" #[{ score := "10", member := "alice" }]
Equations
- client.zAdd key entries = do let reply ← client.execute (LeanRedis.Command.zAdd key entries).request liftM ((LeanRedis.Command.zAdd key entries).decode reply)
Instances For
Remove members from a sorted set.
Example:
let removed ← client.zRem "scores" #["alice"]
Equations
- client.zRem key members = do let reply ← client.execute (LeanRedis.Command.zRem key members).request liftM ((LeanRedis.Command.zRem key members).decode reply)
Instances For
Return the cardinality of a sorted set.
Example:
let size ← client.zCard "scores"
Equations
- client.zCard key = do let reply ← client.execute (LeanRedis.Command.zCard key).request liftM ((LeanRedis.Command.zCard key).decode reply)
Instances For
Return the score of a sorted-set member.
Example:
let score ← client.zScore "scores" "alice"
Equations
- client.zScore key member = do let reply ← client.execute (LeanRedis.Command.zScore key member).request liftM ((LeanRedis.Command.zScore key member).decode reply)
Instances For
Return the scores for multiple sorted-set members.
Example:
let scores ← client.zMScore "scores" #["alice", "bob"]
Equations
- client.zMScore key members = do let reply ← client.execute (LeanRedis.Command.zMScore key members).request liftM ((LeanRedis.Command.zMScore key members).decode reply)
Instances For
Return the rank of a sorted-set member.
Example:
let rank ← client.zRank "scores" "alice"
Equations
- client.zRank key member = do let reply ← client.execute (LeanRedis.Command.zRank key member).request liftM ((LeanRedis.Command.zRank key member).decode reply)
Instances For
Return the reverse rank of a sorted-set member.
Example:
let rank ← client.zRevRank "scores" "alice"
Equations
- client.zRevRank key member = do let reply ← client.execute (LeanRedis.Command.zRevRank key member).request liftM ((LeanRedis.Command.zRevRank key member).decode reply)
Instances For
Return sorted-set members in score order by rank range.
Example:
let members ← client.zRange "scores" 0 (-1)
Equations
- client.zRange key start stop = do let reply ← client.execute (LeanRedis.Command.zRange key start stop).request liftM ((LeanRedis.Command.zRange key start stop).decode reply)
Instances For
Return sorted-set members with scores by rank range.
Example:
let entries ← client.zRangeWithScores "scores" 0 (-1)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Return sorted-set members in reverse score order by rank range.
Example:
let members ← client.zRevRange "scores" 0 (-1)
Equations
- client.zRevRange key start stop = do let reply ← client.execute (LeanRedis.Command.zRevRange key start stop).request liftM ((LeanRedis.Command.zRevRange key start stop).decode reply)
Instances For
Return sorted-set members with scores in reverse score order.
Example:
let entries ← client.zRevRangeWithScores "scores" 0 (-1)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Return sorted-set members within a score range.
Example:
let members ← client.zRangeByScore "scores" "0" "100"
Equations
- client.zRangeByScore key min max = do let reply ← client.execute (LeanRedis.Command.zRangeByScore key min max).request liftM ((LeanRedis.Command.zRangeByScore key min max).decode reply)
Instances For
Return sorted-set members with scores within a score range.
Example:
let entries ← client.zRangeByScoreWithScores "scores" "0" "100"
Equations
- One or more equations did not get rendered due to their size.
Instances For
Return sorted-set members within a reverse score range.
Example:
let members ← client.zRevRangeByScore "scores" "100" "0"
Equations
- client.zRevRangeByScore key max min = do let reply ← client.execute (LeanRedis.Command.zRevRangeByScore key max min).request liftM ((LeanRedis.Command.zRevRangeByScore key max min).decode reply)
Instances For
Return sorted-set members with scores within a reverse score range.
Example:
let entries ← client.zRevRangeByScoreWithScores "scores" "100" "0"
Equations
- One or more equations did not get rendered due to their size.
Instances For
Return sorted-set members within a lexicographic range.
Example:
let members ← client.zRangeByLex "names" "-" "+"
Equations
- client.zRangeByLex key min max = do let reply ← client.execute (LeanRedis.Command.zRangeByLex key min max).request liftM ((LeanRedis.Command.zRangeByLex key min max).decode reply)
Instances For
Return sorted-set members within a reverse lexicographic range.
Example:
let members ← client.zRevRangeByLex "names" "+" "-"
Equations
- client.zRevRangeByLex key max min = do let reply ← client.execute (LeanRedis.Command.zRevRangeByLex key max min).request liftM ((LeanRedis.Command.zRevRangeByLex key max min).decode reply)
Instances For
Count members within a score range.
Example:
let count ← client.zCount "scores" "0" "100"
Equations
- client.zCount key min max = do let reply ← client.execute (LeanRedis.Command.zCount key min max).request liftM ((LeanRedis.Command.zCount key min max).decode reply)
Instances For
Count members within a lexicographic range.
Example:
let count ← client.zLexCount "names" "-" "+"
Equations
- client.zLexCount key min max = do let reply ← client.execute (LeanRedis.Command.zLexCount key min max).request liftM ((LeanRedis.Command.zLexCount key min max).decode reply)
Instances For
Remove members by rank range.
Example:
let removed ← client.zRemRangeByRank "scores" 0 1
Equations
- One or more equations did not get rendered due to their size.
Instances For
Remove members by score range.
Example:
let removed ← client.zRemRangeByScore "scores" "0" "10"
Equations
- client.zRemRangeByScore key min max = do let reply ← client.execute (LeanRedis.Command.zRemRangeByScore key min max).request liftM ((LeanRedis.Command.zRemRangeByScore key min max).decode reply)
Instances For
Remove members by lexicographic range.
Example:
let removed ← client.zRemRangeByLex "names" "-" "+"
Equations
- client.zRemRangeByLex key min max = do let reply ← client.execute (LeanRedis.Command.zRemRangeByLex key min max).request liftM ((LeanRedis.Command.zRemRangeByLex key min max).decode reply)
Instances For
Increment a sorted-set member score.
Example:
let score ← client.zIncrBy "scores" "1.5" "alice"
Equations
- client.zIncrBy key increment member = do let reply ← client.execute (LeanRedis.Command.zIncrBy key increment member).request liftM ((LeanRedis.Command.zIncrBy key increment member).decode reply)
Instances For
Return one random sorted-set member without removing it.
Example:
let member ← client.zRandMember "scores"
Equations
- client.zRandMember key = do let reply ← client.execute (LeanRedis.Command.zRandMember key).request liftM ((LeanRedis.Command.zRandMember key).decode reply)
Instances For
Return random sorted-set members without removing them.
Example:
let members ← client.zRandMembers "scores" 2
Equations
- client.zRandMembers key count = do let reply ← client.execute (LeanRedis.Command.zRandMembers key count).request liftM ((LeanRedis.Command.zRandMembers key count).decode reply)
Instances For
Return random sorted-set members with scores.
Example:
let entries ← client.zRandMembersWithScores "scores" 2
Equations
- One or more equations did not get rendered due to their size.
Instances For
Return the difference of multiple sorted sets.
Example:
let members ← client.zDiff #["a", "b"]
Equations
- client.zDiff keys = do let reply ← client.execute (LeanRedis.Command.zDiff keys).request liftM ((LeanRedis.Command.zDiff keys).decode reply)
Instances For
Store the difference of multiple sorted sets into a destination key.
Example:
let size ← client.zDiffStore "result" #["a", "b"]
Equations
- client.zDiffStore destination keys = do let reply ← client.execute (LeanRedis.Command.zDiffStore destination keys).request liftM ((LeanRedis.Command.zDiffStore destination keys).decode reply)
Instances For
Return the intersection of multiple sorted sets.
Example:
let members ← client.zInter #["a", "b"]
Equations
- client.zInter keys = do let reply ← client.execute (LeanRedis.Command.zInter keys).request liftM ((LeanRedis.Command.zInter keys).decode reply)
Instances For
Return the intersection cardinality of multiple sorted sets.
Example:
let size ← client.zInterCard #["a", "b"]
Equations
- client.zInterCard keys = do let reply ← client.execute (LeanRedis.Command.zInterCard keys).request liftM ((LeanRedis.Command.zInterCard keys).decode reply)
Instances For
Store the intersection of multiple sorted sets into a destination key.
Example:
let size ← client.zInterStore "result" #["a", "b"]
Equations
- client.zInterStore destination keys = do let reply ← client.execute (LeanRedis.Command.zInterStore destination keys).request liftM ((LeanRedis.Command.zInterStore destination keys).decode reply)
Instances For
Return the union of multiple sorted sets.
Example:
let members ← client.zUnion #["a", "b"]
Equations
- client.zUnion keys = do let reply ← client.execute (LeanRedis.Command.zUnion keys).request liftM ((LeanRedis.Command.zUnion keys).decode reply)
Instances For
Store the union of multiple sorted sets into a destination key.
Example:
let size ← client.zUnionStore "result" #["a", "b"]
Equations
- client.zUnionStore destination keys = do let reply ← client.execute (LeanRedis.Command.zUnionStore destination keys).request liftM ((LeanRedis.Command.zUnionStore destination keys).decode reply)
Instances For
Scan a sorted set incrementally.
Example:
let page ← client.zScan "scores" 0
Equations
- client.zScan key cursor options = do let reply ← client.execute (LeanRedis.Command.zScan key cursor options).request liftM ((LeanRedis.Command.zScan key cursor options).decode reply)