Push values to the left side of a list.
Example:
let len ← client.lPush "jobs" #["a", "b"]
Equations
- client.lPush key values = do let reply ← client.execute (LeanRedis.Command.lPush key values).request liftM ((LeanRedis.Command.lPush key values).decode reply)
Instances For
Push values to the right side of a list.
Example:
let len ← client.rPush "jobs" #["a", "b"]
Equations
- client.rPush key values = do let reply ← client.execute (LeanRedis.Command.rPush key values).request liftM ((LeanRedis.Command.rPush key values).decode reply)
Instances For
Push a value to the left only if the list already exists.
Example:
let len ← client.lPushX "jobs" "a"
Equations
- client.lPushX key value = do let reply ← client.execute (LeanRedis.Command.lPushX key value).request liftM ((LeanRedis.Command.lPushX key value).decode reply)
Instances For
Push a value to the right only if the list already exists.
Example:
let len ← client.rPushX "jobs" "a"
Equations
- client.rPushX key value = do let reply ← client.execute (LeanRedis.Command.rPushX key value).request liftM ((LeanRedis.Command.rPushX key value).decode reply)
Instances For
Pop one value from the left side of a list.
Example:
let value ← client.lPop "jobs"
Equations
- client.lPop key = do let reply ← client.execute (LeanRedis.Command.lPop key).request liftM ((LeanRedis.Command.lPop key).decode reply)
Instances For
Pop one value from the right side of a list.
Example:
let value ← client.rPop "jobs"
Equations
- client.rPop key = do let reply ← client.execute (LeanRedis.Command.rPop key).request liftM ((LeanRedis.Command.rPop key).decode reply)
Instances For
Return the current length of a list.
Example:
let len ← client.lLen "jobs"
Equations
- client.lLen key = do let reply ← client.execute (LeanRedis.Command.lLen key).request liftM ((LeanRedis.Command.lLen key).decode reply)
Instances For
Return the value at a list index.
Example:
let value ← client.lIndex "jobs" 0
Equations
- client.lIndex key index = do let reply ← client.execute (LeanRedis.Command.lIndex key index).request liftM ((LeanRedis.Command.lIndex key index).decode reply)
Instances For
Return a range of list elements.
Example:
let values ← client.lRange "jobs" 0 (-1)
Equations
- client.lRange key start stop = do let reply ← client.execute (LeanRedis.Command.lRange key start stop).request liftM ((LeanRedis.Command.lRange key start stop).decode reply)
Instances For
Replace the value at a list index.
Example:
let _ ← client.lSet "jobs" 0 "next"
Equations
- client.lSet key index value = do let reply ← client.execute (LeanRedis.Command.lSet key index value).request liftM ((LeanRedis.Command.lSet key index value).decode reply)
Instances For
Trim a list to the given inclusive range.
Example:
let _ ← client.lTrim "jobs" 0 9
Equations
- client.lTrim key start stop = do let reply ← client.execute (LeanRedis.Command.lTrim key start stop).request liftM ((LeanRedis.Command.lTrim key start stop).decode reply)
Instances For
Remove matching elements from a list.
Example:
let removed ← client.lRem "jobs" 0 "done"
Equations
- client.lRem key count value = do let reply ← client.execute (LeanRedis.Command.lRem key count value).request liftM ((LeanRedis.Command.lRem key count value).decode reply)
Instances For
Insert a value before or after a pivot element.
Example:
let index ← client.lInsert "jobs" .after "a" "b"
Equations
- One or more equations did not get rendered due to their size.
Instances For
Move one element between lists.
Example:
let value ← client.lMove "jobs" "done" .left .right
Equations
- One or more equations did not get rendered due to their size.
Instances For
Return a single matching position from LPOS.
Example:
let pos ← client.lPos "jobs" "a"
Equations
- One or more equations did not get rendered due to their size.
Instances For
Return multiple matching positions from LPOS.
Example:
let positions ← client.lPosMany "jobs" "a" { count? := some 3 }
Equations
- One or more equations did not get rendered due to their size.