(decr conn-or-pool k)
Decrements the numeric value of a key. https://redis.io/commands/decr
Params:
Jedis
/JedisPool
Decrements the numeric value of a key. https://redis.io/commands/decr Params: - conn-or-pool: An instance of `Jedis`/`JedisPool` - k: a string key
(delete conn-or-pool k)
Deletes a key from redis.
Params:
Jedis
/JedisPool
Deletes a key from redis. Params: - conn-or-pool: An instance of `Jedis`/`JedisPool` - k: a string key
(discard-transaction transaction)
Discards the current transaction when called inside a with-multi
block.
Discards the current transaction when called inside a `with-multi` block.
(eval conn-or-pool script keys args)
Evaluates a Lua script in Redis. https://redis.io/commands/eval
Params:
Jedis
/JedisPool
Evaluates a Lua script in Redis. https://redis.io/commands/eval Params: - conn-or-pool: An instance of `Jedis`/`JedisPool` - script: the Lua script to be run - keys: a list of keys to be used as arguments to the script - args: a list of arguments (which are not keys) to be used by the script
(exists? conn-or-pool k)
Check if a key exists. Returns true/false. https://redis.io/commands/exists
Params:
Jedis
/JedisPool
Check if a key exists. Returns true/false. https://redis.io/commands/exists Params: - conn-or-pool: An instance of `Jedis`/`JedisPool` - k: a string key
(expire conn-or-pool k seconds)
Sets the TTL of a key. https://redis.io/commands/expire
Params:
Jedis
/JedisPool
Sets the TTL of a key. https://redis.io/commands/expire Params: - conn-or-pool: An instance of `Jedis`/`JedisPool` - k: a string key - seconds: the TTL in seconds
(expire-at conn-or-pool k unix-timestamp)
Sets the TTL of a key to expire at a particular time. https://redis.io/commands/expireat
Params:
Jedis
/JedisPool
Sets the TTL of a key to expire at a particular time. https://redis.io/commands/expireat Params: - conn-or-pool: An instance of `Jedis`/`JedisPool` - k: a string key - unix-timestamp: the Unix epoch representing the expiration date, as a Long
(flush-all! conn-or-pool)
Removes all keys from all databases in redis
Params:
Jedis
/JedisPool
Removes all keys from all databases in redis Params: - conn-or-pool: An instance of `Jedis`/`JedisPool`
(get conn-or-pool k)
Reads a key from redis.
Params:
Jedis
/JedisPool
Reads a key from redis. Params: - conn-or-pool: An instance of `Jedis`/`JedisPool` - k: a string key
(hdel conn-or-pool key & fields)
Removes the specified fields from the hash stored at key Params:
Jedis
/JedisPool
/JedisCluster
Removes the specified fields from the hash stored at key Params: - conn-or-pool: An instance of `Jedis`/`JedisPool`/`JedisCluster` - key: a string key - field: a variadic string fields
(hget conn-or-pool key field)
Returns the value associated with field in the hash stored at key Params:
Jedis
/JedisPool
/JedisCluster
Returns the value associated with field in the hash stored at key Params: - conn-or-pool: An instance of `Jedis`/`JedisPool`/`JedisCluster` - key: a string key - field: a string field
(hgetall conn-or-pool k)
Returns all fields and values of the hash stored for a given key
Jedis
/JedisPool
/JedisCluster
Returns all fields and values of the hash stored for a given key - conn-or-pool: An instance of `Jedis`/`JedisPool`/`JedisCluster` - k: a string key
(hset conn-or-pool k value)
Writes a clojure map against a key in redis Params:
Jedis
/JedisPool
/JedisCluster
Writes a clojure map against a key in redis Params: - conn-or-pool: An instance of `Jedis`/`JedisPool`/`JedisCluster` - k: a string key - value: a clojure map
(incr conn-or-pool k)
Increments the numeric value of a key.
https://redis.io/commands/incr
Params:
Jedis
/JedisPool
Increments the numeric value of a key. https://redis.io/commands/incr Params: - conn-or-pool: An instance of `Jedis`/`JedisPool` - k: a string key
(mget conn-or-pool keys)
Returns the values of all specified keys. For every key that does not hold a string value or does not exist, the special value nil is returned.
Params:
Jedis
/JedisPool
Returns the values of all specified keys. For every key that does not hold a string value or does not exist, the special value nil is returned. Params: - conn-or-pool: An instance of `Jedis`/`JedisPool` - keys: A list of keys
(mset conn-or-pool key-value-pairs)
Sets the given keys to their respective values.
Params:
Jedis
/JedisPool
Sets the given keys to their respective values. Params: - conn-or-pool: An instance of `Jedis`/`JedisPool` - key-value-pairs: A list of key-value pairs
(sadd conn-or-pool key & members)
Add the specified members to the set stored at key
Params:
Jedis
/JedisPool
/JedisCluster
Add the specified members to the set stored at key Params: - conn-or-pool: An instance of `Jedis`/`JedisPool`/`JedisCluster` - k: a string key - v: a variadic string values
(scan conn-or-pool key-pattern)
Returns a set of all keys that match the provided pattern https://redis.io/commands/scan Params:
Jedis
/JedisPool
Returns a set of all keys that match the provided pattern https://redis.io/commands/scan Params: - conn-or-pool: An instance of `Jedis`/`JedisPool` - key-regex: a string key pattern
(set conn-or-pool k v)
(set conn-or-pool k v {:keys [ttl] :as options})
Writes a value against a key to redis.
Params:
Jedis
/JedisPool
Writes a value against a key to redis. Params: - conn-or-pool: An instance of `Jedis`/`JedisPool` - k: a string key - v: a string value
(smembers conn-or-pool key)
Returns all the members of the set value stored at key
Params:
Jedis
/JedisPool
/JedisCluster
Returns all the members of the set value stored at key Params: - conn-or-pool: An instance of `Jedis`/`JedisPool`/`JedisCluster` - k: a string key
(srem conn-or-pool key & members)
Remove the specified members from the set stored at key
Params:
Jedis
/JedisPool
/JedisCluster
Remove the specified members from the set stored at key Params: - conn-or-pool: An instance of `Jedis`/`JedisPool`/`JedisCluster` - k: a string key - v: a variadic string values
(with-conn [var-sym redis-pool] & body)
Evaluates body in a try-catch expression with the provided name bound to a connection resource from the pool and finally returns the connection back to the pool.
Evaluates body in a try-catch expression with the provided name bound to a connection resource from the pool and finally returns the connection back to the pool.
(with-multi [var-sym pool] & body)
Evaluates body inside a redis MULTI
transaction. The provided name
is bound to a resource from the pool, using which a transaction
is created. The connection will be returned back to the pool at
the end of the transaction.
Also, see discard-transaction
.
Refer https://redis.io/topics/transactions for details on how transactions work.
Evaluates body inside a redis `MULTI` transaction. The provided name is bound to a resource from the pool, using which a transaction is created. The connection will be returned back to the pool at the end of the transaction. Also, see `discard-transaction`. Refer https://redis.io/topics/transactions for details on how transactions work.
(zadd conn-or-pool k v)
Writes a sorted set against a key to redis
Params:
Jedis
/JedisPool
/JedisCluster
{^String :member ^Double score}
Writes a sorted set against a key to redis Params: - conn-or-pool: An instance of `Jedis`/`JedisPool`/`JedisCluster` - k: a string key - v: value as a clojure map of the following format `{^String :member ^Double score}`
(zrange conn-or-pool k start end)
Return a range of members in a sorted set, by index. Params:
Jedis
/JedisPool
/JedisCluster
Return a range of members in a sorted set, by index. Params: - conn-or-pool: An instance of `Jedis`/`JedisPool`/`JedisCluster` - k: a string key - start: an integer index - end: an integer index. They can also be negative numbers indicating offsets from the end of the sorted set
(zrange-with-score conn-or-pool k start end)
Return a range of members in a sorted set, by index along with their scores
Each element in the collection returned in the format: [^Double score ^String member]
Params:
Jedis
/JedisPool
/JedisCluster
Return a range of members in a sorted set, by index along with their scores Each element in the collection returned in the format: `[^Double score ^String member]` Params: - conn-or-pool: An instance of `Jedis`/`JedisPool`/`JedisCluster` - k: a string key - start: an integer index - end: an integer index. They can also be negative numbers indicating offsets from the end of the sorted set
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close