Copy a key to a new key.
Example:
let copied ← client.copy "src" "dst"
Equations
- One or more equations did not get rendered due to their size.
Instances For
Delete one or more keys.
Example:
let removed ← client.del #["key1", "key2"]
Equations
- client.del keys = do let reply ← client.execute (LeanRedis.Command.del keys).request liftM ((LeanRedis.Command.del keys).decode reply)
Instances For
Dump a serialised version of the value stored at a key.
Example:
let serialized ← client.dump "key"
Equations
- client.dump key = do let reply ← client.execute (LeanRedis.Command.dump key).request liftM ((LeanRedis.Command.dump key).decode reply)
Instances For
Determine whether one or more keys exist.
Example:
let count ← client.exists #["key1", "key2"]
Equations
- client.exists keys = do let reply ← client.execute (LeanRedis.Command.exists keys).request liftM ((LeanRedis.Command.exists keys).decode reply)
Instances For
Set a key's time to live in seconds.
Example:
let set ← client.expire "key" 60
Equations
- client.expire key seconds option = do let reply ← client.execute (LeanRedis.Command.expire key seconds option).request liftM ((LeanRedis.Command.expire key seconds option).decode reply)
Instances For
Set a key's time to live as a Unix timestamp in seconds.
Example:
let set ← client.expireAt "key" timestamp
Equations
- One or more equations did not get rendered due to their size.
Instances For
Get the expiration time of a key as a Unix timestamp in seconds.
Example:
let ts ← client.expireTime "key"
Equations
- client.expireTime key = do let reply ← client.execute (LeanRedis.Command.expireTime key).request liftM ((LeanRedis.Command.expireTime key).decode reply)
Instances For
Find all keys matching the given pattern.
Example:
let keys ← client.keys "user:*"
Equations
- client.keys pattern = do let reply ← client.execute (LeanRedis.Command.keys pattern).request liftM ((LeanRedis.Command.keys pattern).decode reply)
Instances For
Move a key to another database.
Example:
let moved ← client.move "key" 1
Equations
- client.move key destinationDb = do let reply ← client.execute (LeanRedis.Command.move key destinationDb).request liftM ((LeanRedis.Command.move key destinationDb).decode reply)
Instances For
Get the internal encoding of a key's value.
Example:
let encoding ← client.objectEncoding "key"
Equations
- client.objectEncoding key = do let reply ← client.execute (LeanRedis.Command.objectEncoding key).request liftM ((LeanRedis.Command.objectEncoding key).decode reply)
Instances For
Get the logarithmic access frequency counter of a key's value.
Example:
let freq ← client.objectFreq "key"
Equations
- client.objectFreq key = do let reply ← client.execute (LeanRedis.Command.objectFreq key).request liftM ((LeanRedis.Command.objectFreq key).decode reply)
Instances For
Get the idle time of a key in seconds.
Example:
let idle ← client.objectIdleTime "key"
Equations
- client.objectIdleTime key = do let reply ← client.execute (LeanRedis.Command.objectIdleTime key).request liftM ((LeanRedis.Command.objectIdleTime key).decode reply)
Instances For
Get the reference count of a key's value.
Example:
let refcount ← client.objectRefCount "key"
Equations
- client.objectRefCount key = do let reply ← client.execute (LeanRedis.Command.objectRefCount key).request liftM ((LeanRedis.Command.objectRefCount key).decode reply)
Instances For
Remove the expiration from a key.
Example:
let removed ← client.persist "key"
Equations
- client.persist key = do let reply ← client.execute (LeanRedis.Command.persist key).request liftM ((LeanRedis.Command.persist key).decode reply)
Instances For
Set a key's time to live in milliseconds.
Example:
let set ← client.pexpire "key" 5000
Equations
- One or more equations did not get rendered due to their size.
Instances For
Set a key's time to live as a Unix timestamp in milliseconds.
Example:
let set ← client.pexpireAt "key" timestamp
Equations
- One or more equations did not get rendered due to their size.
Instances For
Get the time to live for a key in milliseconds.
Example:
let ttl ← client.pttl "key"
Equations
- client.pttl key = do let reply ← client.execute (LeanRedis.Command.pttl key).request liftM ((LeanRedis.Command.pttl key).decode reply)
Instances For
Return a random key from the keyspace.
Example:
let key ← client.randomKey
Equations
- client.randomKey = do let reply ← client.execute LeanRedis.Command.randomKey.request liftM (LeanRedis.Command.randomKey.decode reply)
Instances For
Rename a key.
Example:
let _ ← client.rename "old" "new"
Equations
- client.rename key newKey = do let reply ← client.execute (LeanRedis.Command.rename key newKey).request liftM ((LeanRedis.Command.rename key newKey).decode reply)
Instances For
Rename a key only when the target key does not exist.
Example:
let renamed ← client.renameNx "old" "new"
Equations
- client.renameNx key newKey = do let reply ← client.execute (LeanRedis.Command.renameNx key newKey).request liftM ((LeanRedis.Command.renameNx key newKey).decode reply)
Instances For
Restore a serialised value previously obtained with DUMP.
Example:
let _ ← client.restore "key" 0 serialized
Equations
- One or more equations did not get rendered due to their size.
Instances For
Incrementally iterate the keyspace.
Example:
let page ← client.scan 0
Equations
- client.scan cursor options = do let reply ← client.execute (LeanRedis.Command.scan cursor options).request liftM ((LeanRedis.Command.scan cursor options).decode reply)
Instances For
Sort the elements in a list, set, or sorted set.
NOTE: When using the store? option, Redis returns the number of stored elements
rather than the sorted array. This method expects an array reply; use execute directly
when STORE is specified.
Example:
let elements ← client.sort "mylist"
Equations
- client.sort key options = do let reply ← client.execute (LeanRedis.Command.sort key options).request liftM ((LeanRedis.Command.sort key options).decode reply)
Instances For
Sort the elements in a list, set, or sorted set (read‑only variant).
Example:
let elements ← client.sortRo "mylist"
Equations
- client.sortRo key options = do let reply ← client.execute (LeanRedis.Command.sortRo key options).request liftM ((LeanRedis.Command.sortRo key options).decode reply)
Instances For
Touch one or more keys, updating their access time.
Example:
let touched ← client.touch #["key1", "key2"]
Equations
- client.touch keys = do let reply ← client.execute (LeanRedis.Command.touch keys).request liftM ((LeanRedis.Command.touch keys).decode reply)
Instances For
Get the time to live for a key in seconds.
Example:
let ttl ← client.ttl "key"
Equations
- client.ttl key = do let reply ← client.execute (LeanRedis.Command.TTL key).request liftM ((LeanRedis.Command.TTL key).decode reply)
Instances For
Determine the type of the value stored at a key.
Example:
let type ← client.type "key"
Equations
- client.type key = do let reply ← client.execute (LeanRedis.Command.type key).request liftM ((LeanRedis.Command.type key).decode reply)
Instances For
Delete one or more keys asynchronously (non‑blocking).
Example:
let unlinked ← client.unlink #["key1", "key2"]
Equations
- client.unlink keys = do let reply ← client.execute (LeanRedis.Command.unlink keys).request liftM ((LeanRedis.Command.unlink keys).decode reply)