Liking cljdoc? Tell your friends :D
Clojure only.

taoensso.carmine

Clojure Redis client & message queue.

Clojure Redis client & message queue.
raw docstring

appendclj

(append key value)

Append a value to a key.

APPEND key value

Available since: 2.0.0.

Time complexity: O(1). The amortized time complexity is O(1) assuming the appended value is small and the already present value is of any size, since the dynamic string library used by Redis will double the free space available on every reallocation.

Append a value to a key.

APPEND key value

Available since: 2.0.0.

Time complexity: O(1). The amortized time complexity is O(1) assuming the appended value is small and the already present value is of any size, since the dynamic string library used by Redis will double the free space available on every reallocation.
sourceraw docstring

as-boolclj

(as-bool x)
source

as-doubleclj

DEPRECATED: Use as-float instead.

DEPRECATED: Use `as-float` instead.
sourceraw docstring

as-floatclj

(as-float x)
source

as-intclj

(as-int x)
source

as-longclj

DEPRECATED: Use as-int instead.

DEPRECATED: Use `as-int` instead.
sourceraw docstring

as-mapclj

(as-map x)
source

atomiccljmacro

(atomic conn-opts max-cas-attempts & body)

Alpha - subject to change! Tool to ease Redis transactions for fun & profit. Wraps body in a wcar call that terminates with exec, cleans up reply, and supports automatic retry for failed optimistic locking.

Body must contain a multi call and may contain calls to: watch, unwatch, discard, etc. Ref. http://redis.io/topics/transactions for more info.

return and parse NOT supported after multi has been called.

Like swap! fn, body may be called multiple times so should avoid impure or expensive ops.

;;; Atomically increment integer key without using INCR (atomic {} 100 ; Retry <= 100 times on failed optimistic lock, or throw ex

(watch :my-int-key) ; Watch key for changes (let [;; You can grab the value of the watched key using ;; with-replies (on the current connection), or ;; a nested wcar (on a new connection): curr-val (or (as-long (with-replies (get :my-int-key))) 0)]

(return curr-val)

(multi) ; Start the transaction
  (set :my-int-key (inc curr-val))
  (get :my-int-key)
))

=> [["OK" nil "OK" "QUEUED" "QUEUED"] ; Prelude replies ["OK" "1"] ; Transaction replies (exec reply) ]

See also lua as alternative way to get transactional behaviour.

Alpha - subject to change!
Tool to ease Redis transactions for fun & profit. Wraps body in a `wcar`
call that terminates with `exec`, cleans up reply, and supports automatic
retry for failed optimistic locking.

Body must contain a `multi` call and may contain calls to: `watch`, `unwatch`,
`discard`, etc. Ref. http://redis.io/topics/transactions for more info.

`return` and `parse` NOT supported after `multi` has been called.

Like `swap!` fn, body may be called multiple times so should avoid impure or
expensive ops.

;;; Atomically increment integer key without using INCR
(atomic {} 100 ; Retry <= 100 times on failed optimistic lock, or throw ex

  (watch  :my-int-key) ; Watch key for changes
  (let [;; You can grab the value of the watched key using
        ;; `with-replies` (on the current connection), or
        ;; a nested `wcar` (on a new connection):
        curr-val (or (as-long (with-replies (get :my-int-key))) 0)]

    (return curr-val)

    (multi) ; Start the transaction
      (set :my-int-key (inc curr-val))
      (get :my-int-key)
    ))
=> [["OK" nil "OK" "QUEUED" "QUEUED"] ; Prelude replies
    ["OK" "1"] ; Transaction replies (`exec` reply)
    ]

See also `lua` as alternative way to get transactional behaviour.
sourceraw docstring

atomic*cljmacro

(atomic* conn-opts max-cas-attempts on-success on-failure)

Alpha - subject to change. Low-level transaction util.

Alpha - subject to change. Low-level transaction util.
sourceraw docstring

atomicallycljmacro

(atomically watch-keys & body)

DEPRECATED: Use atomic instead.

DEPRECATED: Use `atomic` instead.
sourceraw docstring

authclj

(auth password)

Authenticate to the server.

AUTH password

Available since: 1.0.0.

Authenticate to the server.

AUTH password

Available since: 1.0.0.
sourceraw docstring

bgrewriteaofclj

(bgrewriteaof)

Asynchronously rewrite the append-only file.

BGREWRITEAOF

Available since: 1.0.0.

Asynchronously rewrite the append-only file.

BGREWRITEAOF 

Available since: 1.0.0.
sourceraw docstring

bgsaveclj

(bgsave)

Asynchronously save the dataset to disk.

BGSAVE

Available since: 1.0.0.

Asynchronously save the dataset to disk.

BGSAVE 

Available since: 1.0.0.
sourceraw docstring

bitcountclj

(bitcount key)
(bitcount key & args)

Count set bits in a string.

BITCOUNT key [start end]

Available since: 2.6.0.

Time complexity: O(N)

Count set bits in a string.

BITCOUNT key [start end]

Available since: 2.6.0.

Time complexity: O(N)
sourceraw docstring

bitfieldclj

(bitfield key)
(bitfield key & args)

Perform arbitrary bitfield integer operations on strings.

BITFIELD key [GET type offset] [SET type offset value] [INCRBY type offset increment] [OVERFLOW WRAP|SAT|FAIL]

Available since: 3.2.0.

Time complexity: O(1) for each subcommand specified

Perform arbitrary bitfield integer operations on strings.

BITFIELD key [GET type offset] [SET type offset value] [INCRBY type offset increment] [OVERFLOW WRAP|SAT|FAIL]

Available since: 3.2.0.

Time complexity: O(1) for each subcommand specified
sourceraw docstring

bitopclj

(bitop operation destkey key)
(bitop operation destkey key & args)

Perform bitwise operations between strings.

BITOP operation destkey key [key ...]

Available since: 2.6.0.

Time complexity: O(N)

Perform bitwise operations between strings.

BITOP operation destkey key [key ...]

Available since: 2.6.0.

Time complexity: O(N)
sourceraw docstring

bitposclj

(bitpos key bit)
(bitpos key bit & args)

Find first bit set or clear in a string.

BITPOS key bit [start] [end]

Available since: 2.8.7.

Time complexity: O(N)

Find first bit set or clear in a string.

BITPOS key bit [start] [end]

Available since: 2.8.7.

Time complexity: O(N)
sourceraw docstring

blpopclj

(blpop key)
(blpop key & args)

Remove and get the first element in a list, or block until one is available.

BLPOP key [key ...] timeout

Available since: 2.0.0.

Time complexity: O(1)

Remove and get the first element in a list, or block until one is available.

BLPOP key [key ...] timeout

Available since: 2.0.0.

Time complexity: O(1)
sourceraw docstring

brpopclj

(brpop key)
(brpop key & args)

Remove and get the last element in a list, or block until one is available.

BRPOP key [key ...] timeout

Available since: 2.0.0.

Time complexity: O(1)

Remove and get the last element in a list, or block until one is available.

BRPOP key [key ...] timeout

Available since: 2.0.0.

Time complexity: O(1)
sourceraw docstring

brpoplpushclj

(brpoplpush source destination timeout)

Pop an element from a list, push it to another list and return it; or block until one is available.

BRPOPLPUSH source destination timeout

Available since: 2.2.0.

Time complexity: O(1)

Pop an element from a list, push it to another list and return it; or block until one is available.

BRPOPLPUSH source destination timeout

Available since: 2.2.0.

Time complexity: O(1)
sourceraw docstring

bzpopmaxclj

(bzpopmax key)
(bzpopmax key & args)

Remove and return the member with the highest score from one or more sorted sets, or block until one is available.

BZPOPMAX key [key ...] timeout

Available since: 5.0.0.

Time complexity: O(log(N)) with N being the number of elements in the sorted set.

Remove and return the member with the highest score from one or more sorted sets, or block until one is available.

BZPOPMAX key [key ...] timeout

Available since: 5.0.0.

Time complexity: O(log(N)) with N being the number of elements in the sorted set.
sourceraw docstring

bzpopminclj

(bzpopmin key)
(bzpopmin key & args)

Remove and return the member with the lowest score from one or more sorted sets, or block until one is available.

BZPOPMIN key [key ...] timeout

Available since: 5.0.0.

Time complexity: O(log(N)) with N being the number of elements in the sorted set.

Remove and return the member with the lowest score from one or more sorted sets, or block until one is available.

BZPOPMIN key [key ...] timeout

Available since: 5.0.0.

Time complexity: O(log(N)) with N being the number of elements in the sorted set.
sourceraw docstring

client-getnameclj

(client-getname)

Get the current connection name.

CLIENT GETNAME

Available since: 2.6.9.

Time complexity: O(1)

Get the current connection name.

CLIENT GETNAME 

Available since: 2.6.9.

Time complexity: O(1)
sourceraw docstring

client-idclj

(client-id)

Returns the client ID for the current connection.

CLIENT ID

Available since: 5.0.0.

Time complexity: O(1)

Returns the client ID for the current connection.

CLIENT ID 

Available since: 5.0.0.

Time complexity: O(1)
sourceraw docstring

client-killclj

(client-kill)
(client-kill & args)

Kill the connection of a client.

CLIENT KILL [ip:port] [ID client-id] [TYPE normal|master|slave|pubsub] [ADDR ip:port] [SKIPME yes/no]

Available since: 2.4.0.

Time complexity: O(N) where N is the number of client connections

Kill the connection of a client.

CLIENT KILL [ip:port] [ID client-id] [TYPE normal|master|slave|pubsub] [ADDR ip:port] [SKIPME yes/no]

Available since: 2.4.0.

Time complexity: O(N) where N is the number of client connections
sourceraw docstring

client-listclj

(client-list)
(client-list & args)

Get the list of client connections.

CLIENT LIST [TYPE normal|master|replica|pubsub]

Available since: 2.4.0.

Time complexity: O(N) where N is the number of client connections

Get the list of client connections.

CLIENT LIST [TYPE normal|master|replica|pubsub]

Available since: 2.4.0.

Time complexity: O(N) where N is the number of client connections
sourceraw docstring

client-pauseclj

(client-pause timeout)

Stop processing commands from clients for some time.

CLIENT PAUSE timeout

Available since: 2.9.50.

Time complexity: O(1)

Stop processing commands from clients for some time.

CLIENT PAUSE timeout

Available since: 2.9.50.

Time complexity: O(1)
sourceraw docstring

client-replyclj

(client-reply reply-mode)

Instruct the server whether to reply to commands.

CLIENT REPLY ON|OFF|SKIP

Available since: 3.2.

Time complexity: O(1)

Instruct the server whether to reply to commands.

CLIENT REPLY ON|OFF|SKIP

Available since: 3.2.

Time complexity: O(1)
sourceraw docstring

client-setnameclj

(client-setname connection-name)

Set the current connection name.

CLIENT SETNAME connection-name

Available since: 2.6.9.

Time complexity: O(1)

Set the current connection name.

CLIENT SETNAME connection-name

Available since: 2.6.9.

Time complexity: O(1)
sourceraw docstring

client-unblockclj

(client-unblock client-id)
(client-unblock client-id & args)

Unblock a client blocked in a blocking command from a different connection.

CLIENT UNBLOCK client-id [TIMEOUT|ERROR]

Available since: 5.0.0.

Time complexity: O(log N) where N is the number of client connections

Unblock a client blocked in a blocking command from a different connection.

CLIENT UNBLOCK client-id [TIMEOUT|ERROR]

Available since: 5.0.0.

Time complexity: O(log N) where N is the number of client connections
sourceraw docstring

close-listenerclj

(close-listener listener)
source

cluster-addslotsclj

(cluster-addslots slot)
(cluster-addslots slot & args)

Assign new hash slots to receiving node.

CLUSTER ADDSLOTS slot [slot ...]

Available since: 3.0.0.

Time complexity: O(N) where N is the total number of hash slot arguments

Assign new hash slots to receiving node.

CLUSTER ADDSLOTS slot [slot ...]

Available since: 3.0.0.

Time complexity: O(N) where N is the total number of hash slot arguments
sourceraw docstring

cluster-count-failure-reportsclj

(cluster-count-failure-reports node-id)

Return the number of failure reports active for a given node.

CLUSTER COUNT-FAILURE-REPORTS node-id

Available since: 3.0.0.

Time complexity: O(N) where N is the number of failure reports

Return the number of failure reports active for a given node.

CLUSTER COUNT-FAILURE-REPORTS node-id

Available since: 3.0.0.

Time complexity: O(N) where N is the number of failure reports
sourceraw docstring

cluster-countkeysinslotclj

(cluster-countkeysinslot slot)

Return the number of local keys in the specified hash slot.

CLUSTER COUNTKEYSINSLOT slot

Available since: 3.0.0.

Time complexity: O(1)

Return the number of local keys in the specified hash slot.

CLUSTER COUNTKEYSINSLOT slot

Available since: 3.0.0.

Time complexity: O(1)
sourceraw docstring

cluster-delslotsclj

(cluster-delslots slot)
(cluster-delslots slot & args)

Set hash slots as unbound in receiving node.

CLUSTER DELSLOTS slot [slot ...]

Available since: 3.0.0.

Time complexity: O(N) where N is the total number of hash slot arguments

Set hash slots as unbound in receiving node.

CLUSTER DELSLOTS slot [slot ...]

Available since: 3.0.0.

Time complexity: O(N) where N is the total number of hash slot arguments
sourceraw docstring

cluster-failoverclj

(cluster-failover)
(cluster-failover & args)

Forces a replica to perform a manual failover of its master..

CLUSTER FAILOVER [FORCE|TAKEOVER]

Available since: 3.0.0.

Time complexity: O(1)

Forces a replica to perform a manual failover of its master..

CLUSTER FAILOVER [FORCE|TAKEOVER]

Available since: 3.0.0.

Time complexity: O(1)
sourceraw docstring

cluster-forgetclj

(cluster-forget node-id)

Remove a node from the nodes table.

CLUSTER FORGET node-id

Available since: 3.0.0.

Time complexity: O(1)

Remove a node from the nodes table.

CLUSTER FORGET node-id

Available since: 3.0.0.

Time complexity: O(1)
sourceraw docstring

cluster-getkeysinslotclj

(cluster-getkeysinslot slot count)

Return local key names in the specified hash slot.

CLUSTER GETKEYSINSLOT slot count

Available since: 3.0.0.

Time complexity: O(log(N)) where N is the number of requested keys

Return local key names in the specified hash slot.

CLUSTER GETKEYSINSLOT slot count

Available since: 3.0.0.

Time complexity: O(log(N)) where N is the number of requested keys
sourceraw docstring

cluster-infoclj

(cluster-info)

Provides info about Redis Cluster node state.

CLUSTER INFO

Available since: 3.0.0.

Time complexity: O(1)

Provides info about Redis Cluster node state.

CLUSTER INFO 

Available since: 3.0.0.

Time complexity: O(1)
sourceraw docstring

cluster-keyslotclj

(cluster-keyslot key)

Returns the hash slot of the specified key.

CLUSTER KEYSLOT key

Available since: 3.0.0.

Time complexity: O(N) where N is the number of bytes in the key

Returns the hash slot of the specified key.

CLUSTER KEYSLOT key

Available since: 3.0.0.

Time complexity: O(N) where N is the number of bytes in the key
sourceraw docstring

cluster-meetclj

(cluster-meet ip port)

Force a node cluster to handshake with another node.

CLUSTER MEET ip port

Available since: 3.0.0.

Time complexity: O(1)

Force a node cluster to handshake with another node.

CLUSTER MEET ip port

Available since: 3.0.0.

Time complexity: O(1)
sourceraw docstring

cluster-nodesclj

(cluster-nodes)

Get Cluster config for the node.

CLUSTER NODES

Available since: 3.0.0.

Time complexity: O(N) where N is the total number of Cluster nodes

Get Cluster config for the node.

CLUSTER NODES 

Available since: 3.0.0.

Time complexity: O(N) where N is the total number of Cluster nodes
sourceraw docstring

cluster-replicasclj

(cluster-replicas node-id)

List replica nodes of the specified master node.

CLUSTER REPLICAS node-id

Available since: 5.0.0.

Time complexity: O(1)

List replica nodes of the specified master node.

CLUSTER REPLICAS node-id

Available since: 5.0.0.

Time complexity: O(1)
sourceraw docstring

cluster-replicateclj

(cluster-replicate node-id)

Reconfigure a node as a replica of the specified master node.

CLUSTER REPLICATE node-id

Available since: 3.0.0.

Time complexity: O(1)

Reconfigure a node as a replica of the specified master node.

CLUSTER REPLICATE node-id

Available since: 3.0.0.

Time complexity: O(1)
sourceraw docstring

cluster-resetclj

(cluster-reset)
(cluster-reset & args)

Reset a Redis Cluster node.

CLUSTER RESET [HARD|SOFT]

Available since: 3.0.0.

Time complexity: O(N) where N is the number of known nodes. The command may execute a FLUSHALL as a side effect.

Reset a Redis Cluster node.

CLUSTER RESET [HARD|SOFT]

Available since: 3.0.0.

Time complexity: O(N) where N is the number of known nodes. The command may execute a FLUSHALL as a side effect.
sourceraw docstring

cluster-saveconfigclj

(cluster-saveconfig)

Forces the node to save cluster state on disk.

CLUSTER SAVECONFIG

Available since: 3.0.0.

Time complexity: O(1)

Forces the node to save cluster state on disk.

CLUSTER SAVECONFIG 

Available since: 3.0.0.

Time complexity: O(1)
sourceraw docstring

cluster-set-config-epochclj

(cluster-set-config-epoch config-epoch)

Set the configuration epoch in a new node.

CLUSTER SET-CONFIG-EPOCH config-epoch

Available since: 3.0.0.

Time complexity: O(1)

Set the configuration epoch in a new node.

CLUSTER SET-CONFIG-EPOCH config-epoch

Available since: 3.0.0.

Time complexity: O(1)
sourceraw docstring

cluster-setslotclj

(cluster-setslot slot subcommand)
(cluster-setslot slot subcommand & args)

Bind a hash slot to a specific node.

CLUSTER SETSLOT slot IMPORTING|MIGRATING|STABLE|NODE [node-id]

Available since: 3.0.0.

Time complexity: O(1)

Bind a hash slot to a specific node.

CLUSTER SETSLOT slot IMPORTING|MIGRATING|STABLE|NODE [node-id]

Available since: 3.0.0.

Time complexity: O(1)
sourceraw docstring

cluster-slavesclj

(cluster-slaves node-id)

List replica nodes of the specified master node.

CLUSTER SLAVES node-id

Available since: 3.0.0.

Time complexity: O(1)

List replica nodes of the specified master node.

CLUSTER SLAVES node-id

Available since: 3.0.0.

Time complexity: O(1)
sourceraw docstring

cluster-slotsclj

(cluster-slots)

Get array of Cluster slot to node mappings.

CLUSTER SLOTS

Available since: 3.0.0.

Time complexity: O(N) where N is the total number of Cluster nodes

Get array of Cluster slot to node mappings.

CLUSTER SLOTS 

Available since: 3.0.0.

Time complexity: O(N) where N is the total number of Cluster nodes
sourceraw docstring

commandclj

(command)

Get array of Redis command details.

COMMAND

Available since: 2.8.13.

Time complexity: O(N) where N is the total number of Redis commands

Get array of Redis command details.

COMMAND 

Available since: 2.8.13.

Time complexity: O(N) where N is the total number of Redis commands
sourceraw docstring

command-countclj

(command-count)

Get total number of Redis commands.

COMMAND COUNT

Available since: 2.8.13.

Time complexity: O(1)

Get total number of Redis commands.

COMMAND COUNT 

Available since: 2.8.13.

Time complexity: O(1)
sourceraw docstring

command-getkeysclj

(command-getkeys)

Extract keys given a full Redis command.

COMMAND GETKEYS

Available since: 2.8.13.

Time complexity: O(N) where N is the number of arguments to the command

Extract keys given a full Redis command.

COMMAND GETKEYS 

Available since: 2.8.13.

Time complexity: O(N) where N is the number of arguments to the command
sourceraw docstring

command-infoclj

(command-info command-name)
(command-info command-name & args)

Get array of specific Redis command details.

COMMAND INFO command-name [command-name ...]

Available since: 2.8.13.

Time complexity: O(N) when N is number of commands to look up

Get array of specific Redis command details.

COMMAND INFO command-name [command-name ...]

Available since: 2.8.13.

Time complexity: O(N) when N is number of commands to look up
sourceraw docstring

compare-and-hsetclj

(compare-and-hset k field old-val new-val)
(compare-and-hset k field old-val ?sha new-val)

Experimental.

Experimental.
sourceraw docstring

compare-and-setclj

(compare-and-set k old-val new-val)
(compare-and-set k old-val ?sha new-val)

Experimental.

Experimental.
sourceraw docstring

config-getclj

(config-get parameter)

Get the value of a configuration parameter.

CONFIG GET parameter

Available since: 2.0.0.

Get the value of a configuration parameter.

CONFIG GET parameter

Available since: 2.0.0.
sourceraw docstring

config-resetstatclj

(config-resetstat)

Reset the stats returned by INFO.

CONFIG RESETSTAT

Available since: 2.0.0.

Time complexity: O(1)

Reset the stats returned by INFO.

CONFIG RESETSTAT 

Available since: 2.0.0.

Time complexity: O(1)
sourceraw docstring

config-rewriteclj

(config-rewrite)

Rewrite the configuration file with the in memory configuration.

CONFIG REWRITE

Available since: 2.8.0.

Rewrite the configuration file with the in memory configuration.

CONFIG REWRITE 

Available since: 2.8.0.
sourceraw docstring

config-setclj

(config-set parameter value)

Set a configuration parameter to the given value.

CONFIG SET parameter value

Available since: 2.0.0.

Set a configuration parameter to the given value.

CONFIG SET parameter value

Available since: 2.0.0.
sourceraw docstring

dbsizeclj

(dbsize)

Return the number of keys in the selected database.

DBSIZE

Available since: 1.0.0.

Return the number of keys in the selected database.

DBSIZE 

Available since: 1.0.0.
sourceraw docstring

debug-objectclj

(debug-object key)

Get debugging information about a key.

DEBUG OBJECT key

Available since: 1.0.0.

Get debugging information about a key.

DEBUG OBJECT key

Available since: 1.0.0.
sourceraw docstring

debug-segfaultclj

(debug-segfault)

Make the server crash.

DEBUG SEGFAULT

Available since: 1.0.0.

Make the server crash.

DEBUG SEGFAULT 

Available since: 1.0.0.
sourceraw docstring

decrclj

(decr key)

Decrement the integer value of a key by one.

DECR key

Available since: 1.0.0.

Time complexity: O(1)

Decrement the integer value of a key by one.

DECR key

Available since: 1.0.0.

Time complexity: O(1)
sourceraw docstring

decrbyclj

(decrby key decrement)

Decrement the integer value of a key by the given number.

DECRBY key decrement

Available since: 1.0.0.

Time complexity: O(1)

Decrement the integer value of a key by the given number.

DECRBY key decrement

Available since: 1.0.0.

Time complexity: O(1)
sourceraw docstring

delclj

(del key)
(del key & args)

Delete a key.

DEL key [key ...]

Available since: 1.0.0.

Time complexity: O(N) where N is the number of keys that will be removed. When a key to remove holds a value other than a string, the individual complexity for this key is O(M) where M is the number of elements in the list, set, sorted set or hash. Removing a single key that holds a string value is O(1).

Delete a key.

DEL key [key ...]

Available since: 1.0.0.

Time complexity: O(N) where N is the number of keys that will be removed. When a key to remove holds a value other than a string, the individual complexity for this key is O(M) where M is the number of elements in the list, set, sorted set or hash. Removing a single key that holds a string value is O(1).
sourceraw docstring

discardclj

(discard)

Discard all commands issued after MULTI.

DISCARD

Available since: 2.0.0.

Discard all commands issued after MULTI.

DISCARD 

Available since: 2.0.0.
sourceraw docstring

dumpclj

(dump key)

Return a serialized version of the value stored at the specified key..

DUMP key

Available since: 2.6.0.

Time complexity: O(1) to access the key and additional O(NM) to serialized it, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1M) where M is small, so simply O(1).

Return a serialized version of the value stored at the specified key..

DUMP key

Available since: 2.6.0.

Time complexity: O(1) to access the key and additional O(N*M) to serialized it, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1).
sourceraw docstring

echoclj

(echo message)

Echo the given string.

ECHO message

Available since: 1.0.0.

Echo the given string.

ECHO message

Available since: 1.0.0.
sourceraw docstring

ensure-atomicallycljmacro

(ensure-atomically {:keys [max-tries] :or {max-tries 100}} watch-keys & body)

DEPRECATED: Use atomic instead.

DEPRECATED: Use `atomic` instead.
sourceraw docstring

evalclj

(eval script numkeys)
(eval script numkeys & args)

Execute a Lua script server side.

EVAL script numkeys key [key ...] arg [arg ...]

Available since: 2.6.0.

Time complexity: Depends on the script that is executed.

Execute a Lua script server side.

EVAL script numkeys key [key ...] arg [arg ...]

Available since: 2.6.0.

Time complexity: Depends on the script that is executed.
sourceraw docstring

eval*clj

(eval* script numkeys & args)

Optimistically tries to send evalsha command for given script. In the event of a "NOSCRIPT" reply, reattempts with eval. Returns the final command's reply. Redis Cluster note: keys need to all be on same shard.

Optimistically tries to send `evalsha` command for given script. In the event
of a "NOSCRIPT" reply, reattempts with `eval`. Returns the final command's
reply. Redis Cluster note: keys need to all be on same shard.
sourceraw docstring

evalshaclj

(evalsha sha1 numkeys)
(evalsha sha1 numkeys & args)

Execute a Lua script server side.

EVALSHA sha1 numkeys key [key ...] arg [arg ...]

Available since: 2.6.0.

Time complexity: Depends on the script that is executed.

Execute a Lua script server side.

EVALSHA sha1 numkeys key [key ...] arg [arg ...]

Available since: 2.6.0.

Time complexity: Depends on the script that is executed.
sourceraw docstring

evalsha*clj

(evalsha* script numkeys & args)

Like evalsha but automatically computes SHA1 hash for script.

Like `evalsha` but automatically computes SHA1 hash for script.
sourceraw docstring

execclj

(exec)

Execute all commands issued after MULTI.

EXEC

Available since: 1.2.0.

Execute all commands issued after MULTI.

EXEC 

Available since: 1.2.0.
sourceraw docstring

existsclj

(exists key)
(exists key & args)

Determine if a key exists.

EXISTS key [key ...]

Available since: 1.0.0.

Time complexity: O(1)

Determine if a key exists.

EXISTS key [key ...]

Available since: 1.0.0.

Time complexity: O(1)
sourceraw docstring

expireclj

(expire key seconds)

Set a key's time to live in seconds.

EXPIRE key seconds

Available since: 1.0.0.

Time complexity: O(1)

Set a key's time to live in seconds.

EXPIRE key seconds

Available since: 1.0.0.

Time complexity: O(1)
sourceraw docstring

expireatclj

(expireat key timestamp)

Set the expiration for a key as a UNIX timestamp.

EXPIREAT key timestamp

Available since: 1.2.0.

Time complexity: O(1)

Set the expiration for a key as a UNIX timestamp.

EXPIREAT key timestamp

Available since: 1.2.0.

Time complexity: O(1)
sourceraw docstring

flushallclj

(flushall)
(flushall & args)

Remove all keys from all databases.

FLUSHALL [ASYNC]

Available since: 1.0.0.

Remove all keys from all databases.

FLUSHALL [ASYNC]

Available since: 1.0.0.
sourceraw docstring

flushdbclj

(flushdb)
(flushdb & args)

Remove all keys from the current database.

FLUSHDB [ASYNC]

Available since: 1.0.0.

Remove all keys from the current database.

FLUSHDB [ASYNC]

Available since: 1.0.0.
sourceraw docstring

freezeclj

(freeze x)
(freeze x opts)

Forces argument of any type (incl. keywords, simple numbers, and binary types) to be subject to automatic de/serialization with Nippy.

Forces argument of any type (incl. keywords, simple numbers, and binary types)
to be subject to automatic de/serialization with Nippy.
sourceraw docstring

geoaddclj

(geoadd key longitude latitude member)
(geoadd key longitude latitude member & args)

Add one or more geospatial items in the geospatial index represented using a sorted set.

GEOADD key longitude latitude member [longitude latitude member ...]

Available since: 3.2.0.

Time complexity: O(log(N)) for each item added, where N is the number of elements in the sorted set.

Add one or more geospatial items in the geospatial index represented using a sorted set.

GEOADD key longitude latitude member [longitude latitude member ...]

Available since: 3.2.0.

Time complexity: O(log(N)) for each item added, where N is the number of elements in the sorted set.
sourceraw docstring

geodistclj

(geodist key member1 member2)
(geodist key member1 member2 & args)

Returns the distance between two members of a geospatial index.

GEODIST key member1 member2 [unit]

Available since: 3.2.0.

Time complexity: O(log(N))

Returns the distance between two members of a geospatial index.

GEODIST key member1 member2 [unit]

Available since: 3.2.0.

Time complexity: O(log(N))
sourceraw docstring

geohashclj

(geohash key member)
(geohash key member & args)

Returns members of a geospatial index as standard geohash strings.

GEOHASH key member [member ...]

Available since: 3.2.0.

Time complexity: O(log(N)) for each member requested, where N is the number of elements in the sorted set.

Returns members of a geospatial index as standard geohash strings.

GEOHASH key member [member ...]

Available since: 3.2.0.

Time complexity: O(log(N)) for each member requested, where N is the number of elements in the sorted set.
sourceraw docstring

geoposclj

(geopos key member)
(geopos key member & args)

Returns longitude and latitude of members of a geospatial index.

GEOPOS key member [member ...]

Available since: 3.2.0.

Time complexity: O(log(N)) for each member requested, where N is the number of elements in the sorted set.

Returns longitude and latitude of members of a geospatial index.

GEOPOS key member [member ...]

Available since: 3.2.0.

Time complexity: O(log(N)) for each member requested, where N is the number of elements in the sorted set.
sourceraw docstring

georadiusclj

(georadius key longitude latitude radius unit)
(georadius key longitude latitude radius unit & args)

Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a point.

GEORADIUS key longitude latitude radius m|km|ft|mi [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count] [ASC|DESC] [STORE key] [STOREDIST key]

Available since: 3.2.0.

Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.

Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a point.

GEORADIUS key longitude latitude radius m|km|ft|mi [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count] [ASC|DESC] [STORE key] [STOREDIST key]

Available since: 3.2.0.

Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
sourceraw docstring

georadiusbymemberclj

(georadiusbymember key member radius unit)
(georadiusbymember key member radius unit & args)

Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a member.

GEORADIUSBYMEMBER key member radius m|km|ft|mi [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count] [ASC|DESC] [STORE key] [STOREDIST key]

Available since: 3.2.0.

Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.

Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a member.

GEORADIUSBYMEMBER key member radius m|km|ft|mi [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count] [ASC|DESC] [STORE key] [STOREDIST key]

Available since: 3.2.0.

Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
sourceraw docstring

getclj

(get key)

Get the value of a key.

GET key

Available since: 1.0.0.

Time complexity: O(1)

Get the value of a key.

GET key

Available since: 1.0.0.

Time complexity: O(1)
sourceraw docstring

getbitclj

(getbit key offset)

Returns the bit value at offset in the string value stored at key.

GETBIT key offset

Available since: 2.2.0.

Time complexity: O(1)

Returns the bit value at offset in the string value stored at key.

GETBIT key offset

Available since: 2.2.0.

Time complexity: O(1)
sourceraw docstring

getrangeclj

(getrange key start end)

Get a substring of the string stored at a key.

GETRANGE key start end

Available since: 2.4.0.

Time complexity: O(N) where N is the length of the returned string. The complexity is ultimately determined by the returned length, but because creating a substring from an existing string is very cheap, it can be considered O(1) for small strings.

Get a substring of the string stored at a key.

GETRANGE key start end

Available since: 2.4.0.

Time complexity: O(N) where N is the length of the returned string. The complexity is ultimately determined by the returned length, but because creating a substring from an existing string is very cheap, it can be considered O(1) for small strings.
sourceraw docstring

getsetclj

(getset key value)

Set the string value of a key and return its old value.

GETSET key value

Available since: 1.0.0.

Time complexity: O(1)

Set the string value of a key and return its old value.

GETSET key value

Available since: 1.0.0.

Time complexity: O(1)
sourceraw docstring

hash-scriptclj

DEPRECATED: Use script-hash instead.

DEPRECATED: Use `script-hash` instead.
sourceraw docstring

hdelclj

(hdel key field)
(hdel key field & args)

Delete one or more hash fields.

HDEL key field [field ...]

Available since: 2.0.0.

Time complexity: O(N) where N is the number of fields to be removed.

Delete one or more hash fields.

HDEL key field [field ...]

Available since: 2.0.0.

Time complexity: O(N) where N is the number of fields to be removed.
sourceraw docstring

hexistsclj

(hexists key field)

Determine if a hash field exists.

HEXISTS key field

Available since: 2.0.0.

Time complexity: O(1)

Determine if a hash field exists.

HEXISTS key field

Available since: 2.0.0.

Time complexity: O(1)
sourceraw docstring

hgetclj

(hget key field)

Get the value of a hash field.

HGET key field

Available since: 2.0.0.

Time complexity: O(1)

Get the value of a hash field.

HGET key field

Available since: 2.0.0.

Time complexity: O(1)
sourceraw docstring

hgetallclj

(hgetall key)

Get all the fields and values in a hash.

HGETALL key

Available since: 2.0.0.

Time complexity: O(N) where N is the size of the hash.

Get all the fields and values in a hash.

HGETALL key

Available since: 2.0.0.

Time complexity: O(N) where N is the size of the hash.
sourceraw docstring

hgetall*clj

(hgetall* key & [keywordize?])

DEPRECATED: Use parse-map instead.

DEPRECATED: Use `parse-map` instead.
sourceraw docstring

hincrbyclj

(hincrby key field increment)

Increment the integer value of a hash field by the given number.

HINCRBY key field increment

Available since: 2.0.0.

Time complexity: O(1)

Increment the integer value of a hash field by the given number.

HINCRBY key field increment

Available since: 2.0.0.

Time complexity: O(1)
sourceraw docstring

hincrbyfloatclj

(hincrbyfloat key field increment)

Increment the float value of a hash field by the given amount.

HINCRBYFLOAT key field increment

Available since: 2.6.0.

Time complexity: O(1)

Increment the float value of a hash field by the given amount.

HINCRBYFLOAT key field increment

Available since: 2.6.0.

Time complexity: O(1)
sourceraw docstring

hkeysclj

(hkeys key)

Get all the fields in a hash.

HKEYS key

Available since: 2.0.0.

Time complexity: O(N) where N is the size of the hash.

Get all the fields in a hash.

HKEYS key

Available since: 2.0.0.

Time complexity: O(N) where N is the size of the hash.
sourceraw docstring

hlenclj

(hlen key)

Get the number of fields in a hash.

HLEN key

Available since: 2.0.0.

Time complexity: O(1)

Get the number of fields in a hash.

HLEN key

Available since: 2.0.0.

Time complexity: O(1)
sourceraw docstring

hmgetclj

(hmget key field)
(hmget key field & args)

Get the values of all the given hash fields.

HMGET key field [field ...]

Available since: 2.0.0.

Time complexity: O(N) where N is the number of fields being requested.

Get the values of all the given hash fields.

HMGET key field [field ...]

Available since: 2.0.0.

Time complexity: O(N) where N is the number of fields being requested.
sourceraw docstring

hmget*clj

(hmget* key field & more)

DEPRECATED: Use parse-map instead.

DEPRECATED: Use `parse-map` instead.
sourceraw docstring

hmsetclj

(hmset key field value)
(hmset key field value & args)

Set multiple hash fields to multiple values.

HMSET key field value [field value ...]

Available since: 2.0.0.

Time complexity: O(N) where N is the number of fields being set.

Set multiple hash fields to multiple values.

HMSET key field value [field value ...]

Available since: 2.0.0.

Time complexity: O(N) where N is the number of fields being set.
sourceraw docstring

hmset*clj

(hmset* key m)

Like hmset but takes a map argument.

Like `hmset` but takes a map argument.
sourceraw docstring

hmsetnxclj

Experimental.

Experimental.
sourceraw docstring

hscanclj

(hscan key cursor)
(hscan key cursor & args)

Incrementally iterate hash fields and associated values.

HSCAN key cursor [MATCH pattern] [COUNT count]

Available since: 2.8.0.

Time complexity: O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection..

Incrementally iterate hash fields and associated values.

HSCAN key cursor [MATCH pattern] [COUNT count]

Available since: 2.8.0.

Time complexity: O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection..
sourceraw docstring

hsetclj

(hset key field value)
(hset key field value & args)

Set the string value of a hash field.

HSET key field value [field value ...]

Available since: 2.0.0.

Time complexity: O(1) for each field/value pair added, so O(N) to add N field/value pairs when the command is called with multiple field/value pairs.

Set the string value of a hash field.

HSET key field value [field value ...]

Available since: 2.0.0.

Time complexity: O(1) for each field/value pair added, so O(N) to add N field/value pairs when the command is called with multiple field/value pairs.
sourceraw docstring

hsetnxclj

(hsetnx key field value)

Set the value of a hash field, only if the field does not exist.

HSETNX key field value

Available since: 2.0.0.

Time complexity: O(1)

Set the value of a hash field, only if the field does not exist.

HSETNX key field value

Available since: 2.0.0.

Time complexity: O(1)
sourceraw docstring

hstrlenclj

(hstrlen key field)

Get the length of the value of a hash field.

HSTRLEN key field

Available since: 3.2.0.

Time complexity: O(1)

Get the length of the value of a hash field.

HSTRLEN key field

Available since: 3.2.0.

Time complexity: O(1)
sourceraw docstring

hswapclj

Experimental.

Experimental.
sourceraw docstring

hvalsclj

(hvals key)

Get all the values in a hash.

HVALS key

Available since: 2.0.0.

Time complexity: O(N) where N is the size of the hash.

Get all the values in a hash.

HVALS key

Available since: 2.0.0.

Time complexity: O(N) where N is the size of the hash.
sourceraw docstring

incrclj

(incr key)

Increment the integer value of a key by one.

INCR key

Available since: 1.0.0.

Time complexity: O(1)

Increment the integer value of a key by one.

INCR key

Available since: 1.0.0.

Time complexity: O(1)
sourceraw docstring

incrbyclj

(incrby key increment)

Increment the integer value of a key by the given amount.

INCRBY key increment

Available since: 1.0.0.

Time complexity: O(1)

Increment the integer value of a key by the given amount.

INCRBY key increment

Available since: 1.0.0.

Time complexity: O(1)
sourceraw docstring

incrbyfloatclj

(incrbyfloat key increment)

Increment the float value of a key by the given amount.

INCRBYFLOAT key increment

Available since: 2.6.0.

Time complexity: O(1)

Increment the float value of a key by the given amount.

INCRBYFLOAT key increment

Available since: 2.6.0.

Time complexity: O(1)
sourceraw docstring

infoclj

(info)
(info & args)

Get information and statistics about the server.

INFO [section]

Available since: 1.0.0.

Get information and statistics about the server.

INFO [section]

Available since: 1.0.0.
sourceraw docstring

info*clj

(info* & [clojureize?])

Like info but automatically coerces reply into a hash-map.

Like `info` but automatically coerces reply into a hash-map.
sourceraw docstring

keyclj

(key & parts)

Joins parts to form an idiomatic compound Redis key name. Suggested style:

  • "category:subcategory:id:field" basic form.
  • Singular category names ("account" rather than "accounts").
  • Plural field names when appropriate ("account:friends").
  • Dashes for long names ("email-address" rather than "emailAddress", etc.).
Joins parts to form an idiomatic compound Redis key name. Suggested style:
* "category:subcategory:id:field" basic form.
* Singular category names ("account" rather than "accounts").
* Plural _field_ names when appropriate ("account:friends").
* Dashes for long names ("email-address" rather than "emailAddress", etc.).
sourceraw docstring

key*clj

(key* parts)
source

keysclj

(keys pattern)

Find all keys matching the given pattern.

KEYS pattern

Available since: 1.0.0.

Time complexity: O(N) with N being the number of keys in the database, under the assumption that the key names in the database and the given pattern have limited length.

Find all keys matching the given pattern.

KEYS pattern

Available since: 1.0.0.

Time complexity: O(N) with N being the number of keys in the database, under the assumption that the key names in the database and the given pattern have limited length.
sourceraw docstring

knameclj

(kname & parts)

DEPRECATED: Use key instead. key does not filter nil parts.

DEPRECATED: Use `key` instead. `key` does not filter nil parts.
sourceraw docstring

lastsaveclj

(lastsave)

Get the UNIX time stamp of the last successful save to disk.

LASTSAVE

Available since: 1.0.0.

Get the UNIX time stamp of the last successful save to disk.

LASTSAVE 

Available since: 1.0.0.
sourceraw docstring

lindexclj

(lindex key index)

Get an element from a list by its index.

LINDEX key index

Available since: 1.0.0.

Time complexity: O(N) where N is the number of elements to traverse to get to the element at index. This makes asking for the first or the last element of the list O(1).

Get an element from a list by its index.

LINDEX key index

Available since: 1.0.0.

Time complexity: O(N) where N is the number of elements to traverse to get to the element at index. This makes asking for the first or the last element of the list O(1).
sourceraw docstring

linsertclj

(linsert key where pivot element)

Insert an element before or after another element in a list.

LINSERT key BEFORE|AFTER pivot element

Available since: 2.2.0.

Time complexity: O(N) where N is the number of elements to traverse before seeing the value pivot. This means that inserting somewhere on the left end on the list (head) can be considered O(1) and inserting somewhere on the right end (tail) is O(N).

Insert an element before or after another element in a list.

LINSERT key BEFORE|AFTER pivot element

Available since: 2.2.0.

Time complexity: O(N) where N is the number of elements to traverse before seeing the value pivot. This means that inserting somewhere on the left end on the list (head) can be considered O(1) and inserting somewhere on the right end (tail) is O(N).
sourceraw docstring

llenclj

(llen key)

Get the length of a list.

LLEN key

Available since: 1.0.0.

Time complexity: O(1)

Get the length of a list.

LLEN key

Available since: 1.0.0.

Time complexity: O(1)
sourceraw docstring

lolwutclj

(lolwut)
(lolwut & args)

Display some computer art and the Redis version.

LOLWUT [VERSION version]

Available since: 5.0.0.

Display some computer art and the Redis version.

LOLWUT [VERSION version]

Available since: 5.0.0.
sourceraw docstring

lpopclj

(lpop key)

Remove and get the first element in a list.

LPOP key

Available since: 1.0.0.

Time complexity: O(1)

Remove and get the first element in a list.

LPOP key

Available since: 1.0.0.

Time complexity: O(1)
sourceraw docstring

lpushclj

(lpush key element)
(lpush key element & args)

Prepend one or multiple elements to a list.

LPUSH key element [element ...]

Available since: 1.0.0.

Time complexity: O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.

Prepend one or multiple elements to a list.

LPUSH key element [element ...]

Available since: 1.0.0.

Time complexity: O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.
sourceraw docstring

lpushxclj

(lpushx key element)
(lpushx key element & args)

Prepend an element to a list, only if the list exists.

LPUSHX key element [element ...]

Available since: 2.2.0.

Time complexity: O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.

Prepend an element to a list, only if the list exists.

LPUSHX key element [element ...]

Available since: 2.2.0.

Time complexity: O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.
sourceraw docstring

lrangeclj

(lrange key start stop)

Get a range of elements from a list.

LRANGE key start stop

Available since: 1.0.0.

Time complexity: O(S+N) where S is the distance of start offset from HEAD for small lists, from nearest end (HEAD or TAIL) for large lists; and N is the number of elements in the specified range.

Get a range of elements from a list.

LRANGE key start stop

Available since: 1.0.0.

Time complexity: O(S+N) where S is the distance of start offset from HEAD for small lists, from nearest end (HEAD or TAIL) for large lists; and N is the number of elements in the specified range.
sourceraw docstring

lremclj

(lrem key count element)

Remove elements from a list.

LREM key count element

Available since: 1.0.0.

Time complexity: O(N+M) where N is the length of the list and M is the number of elements removed.

Remove elements from a list.

LREM key count element

Available since: 1.0.0.

Time complexity: O(N+M) where N is the length of the list and M is the number of elements removed.
sourceraw docstring

lsetclj

(lset key index element)

Set the value of an element in a list by its index.

LSET key index element

Available since: 1.0.0.

Time complexity: O(N) where N is the length of the list. Setting either the first or the last element of the list is O(1).

Set the value of an element in a list by its index.

LSET key index element

Available since: 1.0.0.

Time complexity: O(N) where N is the length of the list. Setting either the first or the last element of the list is O(1).
sourceraw docstring

ltrimclj

(ltrim key start stop)

Trim a list to the specified range.

LTRIM key start stop

Available since: 1.0.0.

Time complexity: O(N) where N is the number of elements to be removed by the operation.

Trim a list to the specified range.

LTRIM key start stop

Available since: 1.0.0.

Time complexity: O(N) where N is the number of elements to be removed by the operation.
sourceraw docstring

luaclj

(lua script keys args)

All singing, all dancing Lua script helper. Like eval* but allows script vars to be provided as {<var> <value> ...} maps:

(lua "redis.call('set', _:my-key, _:my-arg)" {:my-key "foo} {:my-arg "bar"})

Keys are separate from other args as an implementation detail for clustering purposes (keys need to all be on same shard).

All singing, all dancing Lua script helper. Like `eval*` but allows script
vars to be provided as {<var> <value> ...} maps:

(lua "redis.call('set', _:my-key, _:my-arg)" {:my-key "foo} {:my-arg "bar"})

Keys are separate from other args as an implementation detail for clustering
purposes (keys need to all be on same shard).
sourceraw docstring

lua-localclj

(lua-local script keys args)

Alpha - subject to change. Like lua, but optimized for the single-server, single-client case: maintains set of Lua scripts previously loaded by this client and will not speculate on script availability. CANNOT be used in environments where Redis servers may go down and come back up again independently of application servers (clients).

Alpha - subject to change.
Like `lua`, but optimized for the single-server, single-client case: maintains
set of Lua scripts previously loaded by this client and will _not_ speculate
on script availability. CANNOT be used in environments where Redis servers may
go down and come back up again independently of application servers (clients).
sourceraw docstring

lua-scriptclj

(lua-script & args)

DEPRECATED: Use lua instead.

DEPRECATED: Use `lua` instead.
sourceraw docstring

make-conn-poolclj

(make-conn-pool & opts)

DEPRECATED: Use wcar instead.

DEPRECATED: Use `wcar` instead.
sourceraw docstring

make-conn-specclj

(make-conn-spec & opts)

DEPRECATED: Use wcar instead.

DEPRECATED: Use `wcar` instead.
sourceraw docstring

make-keyfnclj

(make-keyfn & prefix-parts)

DEPRECATED: Use kname instead.

DEPRECATED: Use `kname` instead.
sourceraw docstring

memory-doctorclj

(memory-doctor)

Outputs memory problems report.

MEMORY DOCTOR

Available since: 4.0.0.

Outputs memory problems report.

MEMORY DOCTOR 

Available since: 4.0.0.
sourceraw docstring

memory-helpclj

(memory-help)

Show helpful text about the different subcommands.

MEMORY HELP

Available since: 4.0.0.

Show helpful text about the different subcommands.

MEMORY HELP 

Available since: 4.0.0.
sourceraw docstring

memory-malloc-statsclj

(memory-malloc-stats)

Show allocator internal stats.

MEMORY MALLOC-STATS

Available since: 4.0.0.

Show allocator internal stats.

MEMORY MALLOC-STATS 

Available since: 4.0.0.
sourceraw docstring

memory-purgeclj

(memory-purge)

Ask the allocator to release memory.

MEMORY PURGE

Available since: 4.0.0.

Ask the allocator to release memory.

MEMORY PURGE 

Available since: 4.0.0.
sourceraw docstring

memory-statsclj

(memory-stats)

Show memory usage details.

MEMORY STATS

Available since: 4.0.0.

Show memory usage details.

MEMORY STATS 

Available since: 4.0.0.
sourceraw docstring

memory-usageclj

(memory-usage key)
(memory-usage key & args)

Estimate the memory usage of a key.

MEMORY USAGE key [SAMPLES count]

Available since: 4.0.0.

Time complexity: O(N) where N is the number of samples.

Estimate the memory usage of a key.

MEMORY USAGE key [SAMPLES count]

Available since: 4.0.0.

Time complexity: O(N) where N is the number of samples.
sourceraw docstring

mgetclj

(mget key)
(mget key & args)

Get the values of all the given keys.

MGET key [key ...]

Available since: 1.0.0.

Time complexity: O(N) where N is the number of keys to retrieve.

Get the values of all the given keys.

MGET key [key ...]

Available since: 1.0.0.

Time complexity: O(N) where N is the number of keys to retrieve.
sourceraw docstring

migrateclj

(migrate host port key destination-db timeout)
(migrate host port key destination-db timeout & args)

Atomically transfer a key from a Redis instance to another one..

MIGRATE host port key|"" destination-db timeout [COPY] [REPLACE] [AUTH password] [KEYS key]

Available since: 2.6.0.

Time complexity: This command actually executes a DUMP+DEL in the source instance, and a RESTORE in the target instance. See the pages of these commands for time complexity. Also an O(N) data transfer between the two instances is performed.

Atomically transfer a key from a Redis instance to another one..

MIGRATE host port key|"" destination-db timeout [COPY] [REPLACE] [AUTH password] [KEYS key]

Available since: 2.6.0.

Time complexity: This command actually executes a DUMP+DEL in the source instance, and a RESTORE in the target instance. See the pages of these commands for time complexity. Also an O(N) data transfer between the two instances is performed.
sourceraw docstring

module-listclj

(module-list)

List all modules loaded by the server.

MODULE LIST

Available since: 4.0.0.

Time complexity: O(N) where N is the number of loaded modules.

List all modules loaded by the server.

MODULE LIST 

Available since: 4.0.0.

Time complexity: O(N) where N is the number of loaded modules.
sourceraw docstring

module-loadclj

(module-load path)
(module-load path & args)

Load a module.

MODULE LOAD path [arg]

Available since: 4.0.0.

Time complexity: O(1)

Load a module.

MODULE LOAD path [arg]

Available since: 4.0.0.

Time complexity: O(1)
sourceraw docstring

module-unloadclj

(module-unload name)

Unload a module.

MODULE UNLOAD name

Available since: 4.0.0.

Time complexity: O(1)

Unload a module.

MODULE UNLOAD name

Available since: 4.0.0.

Time complexity: O(1)
sourceraw docstring

monitorclj

(monitor)

Listen for all requests received by the server in real time.

MONITOR

Available since: 1.0.0.

Listen for all requests received by the server in real time.

MONITOR 

Available since: 1.0.0.
sourceraw docstring

moveclj

(move key db)

Move a key to another database.

MOVE key db

Available since: 1.0.0.

Time complexity: O(1)

Move a key to another database.

MOVE key db

Available since: 1.0.0.

Time complexity: O(1)
sourceraw docstring

msetclj

(mset key value)
(mset key value & args)

Set multiple keys to multiple values.

MSET key value [key value ...]

Available since: 1.0.1.

Time complexity: O(N) where N is the number of keys to set.

Set multiple keys to multiple values.

MSET key value [key value ...]

Available since: 1.0.1.

Time complexity: O(N) where N is the number of keys to set.
sourceraw docstring

msetnxclj

(msetnx key value)
(msetnx key value & args)

Set multiple keys to multiple values, only if none of the keys exist.

MSETNX key value [key value ...]

Available since: 1.0.1.

Time complexity: O(N) where N is the number of keys to set.

Set multiple keys to multiple values, only if none of the keys exist.

MSETNX key value [key value ...]

Available since: 1.0.1.

Time complexity: O(N) where N is the number of keys to set.
sourceraw docstring

multiclj

(multi)

Mark the start of a transaction block.

MULTI

Available since: 1.2.0.

Mark the start of a transaction block.

MULTI 

Available since: 1.2.0.
sourceraw docstring

objectclj

(object subcommand)
(object subcommand & args)

Inspect the internals of Redis objects.

OBJECT subcommand [arguments [arguments ...]]

Available since: 2.2.3.

Time complexity: O(1) for all the currently implemented subcommands.

Inspect the internals of Redis objects.

OBJECT subcommand [arguments [arguments ...]]

Available since: 2.2.3.

Time complexity: O(1) for all the currently implemented subcommands.
sourceraw docstring

parsecljmacro

(parse f & body)

Wraps body so that replies to any wrapped Redis commands will be parsed with (f reply). Replaces any current parser; removes parser when f is nil. See also parser-comp.

Wraps body so that replies to any wrapped Redis commands will be parsed with
`(f reply)`. Replaces any current parser; removes parser when `f` is nil.
See also `parser-comp`.
sourceraw docstring

parse-boolcljmacro

(parse-bool & body)
source

parse-doublecljmacro

(parse-double & body)

DEPRECATED: Use parse-float instead.

DEPRECATED: Use `parse-float` instead.
sourceraw docstring

parse-floatcljmacro

(parse-float & body)
source

parse-intcljmacro

(parse-int & body)
source

parse-keywordcljmacro

(parse-keyword & body)
source

parse-longcljmacro

(parse-long & body)

DEPRECATED: Use parse-int instead.

DEPRECATED: Use `parse-int` instead.
sourceraw docstring

parse-mapcljmacro

(parse-map form & [kf vf])
source

parse-nippycljmacro

(parse-nippy thaw-opts & body)
source

parse-rawcljmacro

(parse-raw & body)
source

parse-suppresscljmacro

(parse-suppress & body)
source

parser-compclj

(parser-comp f g)

Composes parsers when f or g are nnil, preserving metadata

Composes parsers when f or g are nnil, preserving metadata
sourceraw docstring

persistclj

(persist key)

Remove the expiration from a key.

PERSIST key

Available since: 2.2.0.

Time complexity: O(1)

Remove the expiration from a key.

PERSIST key

Available since: 2.2.0.

Time complexity: O(1)
sourceraw docstring

pexpireclj

(pexpire key milliseconds)

Set a key's time to live in milliseconds.

PEXPIRE key milliseconds

Available since: 2.6.0.

Time complexity: O(1)

Set a key's time to live in milliseconds.

PEXPIRE key milliseconds

Available since: 2.6.0.

Time complexity: O(1)
sourceraw docstring

pexpireatclj

(pexpireat key milliseconds-timestamp)

Set the expiration for a key as a UNIX timestamp specified in milliseconds.

PEXPIREAT key milliseconds-timestamp

Available since: 2.6.0.

Time complexity: O(1)

Set the expiration for a key as a UNIX timestamp specified in milliseconds.

PEXPIREAT key milliseconds-timestamp

Available since: 2.6.0.

Time complexity: O(1)
sourceraw docstring

pfaddclj

(pfadd key element)
(pfadd key element & args)

Adds the specified elements to the specified HyperLogLog..

PFADD key element [element ...]

Available since: 2.8.9.

Time complexity: O(1) to add every element.

Adds the specified elements to the specified HyperLogLog..

PFADD key element [element ...]

Available since: 2.8.9.

Time complexity: O(1) to add every element.
sourceraw docstring

pfcountclj

(pfcount key)
(pfcount key & args)

Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s)..

PFCOUNT key [key ...]

Available since: 2.8.9.

Time complexity: O(1) with a very small average constant time when called with a single key. O(N) with N being the number of keys, and much bigger constant times, when called with multiple keys.

Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s)..

PFCOUNT key [key ...]

Available since: 2.8.9.

Time complexity: O(1) with a very small average constant time when called with a single key. O(N) with N being the number of keys, and much bigger constant times, when called with multiple keys.
sourceraw docstring

pfmergeclj

(pfmerge destkey sourcekey)
(pfmerge destkey sourcekey & args)

Merge N different HyperLogLogs into a single one..

PFMERGE destkey sourcekey [sourcekey ...]

Available since: 2.8.9.

Time complexity: O(N) to merge N HyperLogLogs, but with high constant times.

Merge N different HyperLogLogs into a single one..

PFMERGE destkey sourcekey [sourcekey ...]

Available since: 2.8.9.

Time complexity: O(N) to merge N HyperLogLogs, but with high constant times.
sourceraw docstring

pingclj

(ping)
(ping & args)

Ping the server.

PING [message]

Available since: 1.0.0.

Ping the server.

PING [message]

Available since: 1.0.0.
sourceraw docstring

preserveclj

DEPRECATED: Use freeze instead.

DEPRECATED: Use `freeze` instead.
sourceraw docstring

psetexclj

(psetex key milliseconds value)

Set the value and expiration in milliseconds of a key.

PSETEX key milliseconds value

Available since: 2.6.0.

Time complexity: O(1)

Set the value and expiration in milliseconds of a key.

PSETEX key milliseconds value

Available since: 2.6.0.

Time complexity: O(1)
sourceraw docstring

psubscribeclj

(psubscribe pattern)
(psubscribe pattern & args)

Listen for messages published to channels matching the given patterns.

PSUBSCRIBE pattern [pattern ...]

Available since: 2.0.0.

Time complexity: O(N) where N is the number of patterns the client is already subscribed to.

Listen for messages published to channels matching the given patterns.

PSUBSCRIBE pattern [pattern ...]

Available since: 2.0.0.

Time complexity: O(N) where N is the number of patterns the client is already subscribed to.
sourceraw docstring

psyncclj

(psync replicationid offset)

Internal command used for replication.

PSYNC replicationid offset

Available since: 2.8.0.

Internal command used for replication.

PSYNC replicationid offset

Available since: 2.8.0.
sourceraw docstring

pttlclj

(pttl key)

Get the time to live for a key in milliseconds.

PTTL key

Available since: 2.6.0.

Time complexity: O(1)

Get the time to live for a key in milliseconds.

PTTL key

Available since: 2.6.0.

Time complexity: O(1)
sourceraw docstring

publishclj

(publish channel message)

Post a message to a channel.

PUBLISH channel message

Available since: 2.0.0.

Time complexity: O(N+M) where N is the number of clients subscribed to the receiving channel and M is the total number of subscribed patterns (by any client).

Post a message to a channel.

PUBLISH channel message

Available since: 2.0.0.

Time complexity: O(N+M) where N is the number of clients subscribed to the receiving channel and M is the total number of subscribed patterns (by any client).
sourceraw docstring

pubsubclj

(pubsub subcommand)
(pubsub subcommand & args)

Inspect the state of the Pub/Sub subsystem.

PUBSUB subcommand [argument [argument ...]]

Available since: 2.8.0.

Time complexity: O(N) for the CHANNELS subcommand, where N is the number of active channels, and assuming constant time pattern matching (relatively short channels and patterns). O(N) for the NUMSUB subcommand, where N is the number of requested channels. O(1) for the NUMPAT subcommand.

Inspect the state of the Pub/Sub subsystem.

PUBSUB subcommand [argument [argument ...]]

Available since: 2.8.0.

Time complexity: O(N) for the CHANNELS subcommand, where N is the number of active channels, and assuming constant time pattern matching (relatively short channels and patterns). O(N) for the NUMSUB subcommand, where N is the number of requested channels. O(1) for the NUMPAT subcommand.
sourceraw docstring

punsubscribeclj

(punsubscribe)
(punsubscribe & args)

Stop listening for messages posted to channels matching the given patterns.

PUNSUBSCRIBE [pattern [pattern ...]]

Available since: 2.0.0.

Time complexity: O(N+M) where N is the number of patterns the client is already subscribed and M is the number of total patterns subscribed in the system (by any client).

Stop listening for messages posted to channels matching the given patterns.

PUNSUBSCRIBE [pattern [pattern ...]]

Available since: 2.0.0.

Time complexity: O(N+M) where N is the number of patterns the client is already subscribed and M is the number of total patterns subscribed in the system (by any client).
sourceraw docstring

quitclj

(quit)

Close the connection.

QUIT

Available since: 1.0.0.

Close the connection.

QUIT 

Available since: 1.0.0.
sourceraw docstring

randomkeyclj

(randomkey)

Return a random key from the keyspace.

RANDOMKEY

Available since: 1.0.0.

Time complexity: O(1)

Return a random key from the keyspace.

RANDOMKEY 

Available since: 1.0.0.

Time complexity: O(1)
sourceraw docstring

rawclj

(raw x)

Forces byte[] argument to be sent to Redis as raw, unencoded bytes.

Forces byte[] argument to be sent to Redis as raw, unencoded bytes.
sourceraw docstring

readonlyclj

(readonly)

Enables read queries for a connection to a cluster replica node.

READONLY

Available since: 3.0.0.

Time complexity: O(1)

Enables read queries for a connection to a cluster replica node.

READONLY 

Available since: 3.0.0.

Time complexity: O(1)
sourceraw docstring

readwriteclj

(readwrite)

Disables read queries for a connection to a cluster replica node.

READWRITE

Available since: 3.0.0.

Time complexity: O(1)

Disables read queries for a connection to a cluster replica node.

READWRITE 

Available since: 3.0.0.

Time complexity: O(1)
sourceraw docstring

redis-callclj

(redis-call & requests)

Sends low-level requests to Redis. Useful for DSLs, certain kinds of command composition, and for executing commands that haven't yet been added to the official commands.json spec.

(redis-call [:set "foo" "bar"] [:get "foo"])

Sends low-level requests to Redis. Useful for DSLs, certain kinds of command
composition, and for executing commands that haven't yet been added to the
official `commands.json` spec.

(redis-call [:set "foo" "bar"] [:get "foo"])
sourceraw docstring

reduce-hscanclj

(reduce-hscan rf scan-fn)
(reduce-hscan rf acc-init scan-fn)

Experimental. Like reduce-scan but:

  • rf is (fn [acc k v]), as in reduce-kv.
  • rf will never be called with the same key twice (i.e. automatically de-duplicates elements).
Experimental. Like `reduce-scan` but:
- `rf` is (fn [acc k v]), as in `reduce-kv`.
- `rf` will never be called with the same key twice
  (i.e. automatically de-duplicates elements).
sourceraw docstring

reduce-scanclj

(reduce-scan rf scan-fn)
(reduce-scan rf acc-init scan-fn)

For use with scan, hscan, zscan, etc. Takes:

  • (fn rf [acc scan-result]) -> next accumulator
  • (fn scan-fn [cursor]) -> next scan result
For use with `scan`, `hscan`, `zscan`, etc. Takes:
- (fn rf      [acc scan-result]) -> next accumulator
- (fn scan-fn [cursor]) -> next scan result
sourceraw docstring

rememberclj

DEPRECATED: Use return instead.

DEPRECATED: Use `return` instead.
sourceraw docstring

renameclj

(rename key newkey)

Rename a key.

RENAME key newkey

Available since: 1.0.0.

Time complexity: O(1)

Rename a key.

RENAME key newkey

Available since: 1.0.0.

Time complexity: O(1)
sourceraw docstring

renamenxclj

(renamenx key newkey)

Rename a key, only if the new key does not exist.

RENAMENX key newkey

Available since: 1.0.0.

Time complexity: O(1)

Rename a key, only if the new key does not exist.

RENAMENX key newkey

Available since: 1.0.0.

Time complexity: O(1)
sourceraw docstring

replicaofclj

(replicaof host port)

Make the server a replica of another instance, or promote it as master..

REPLICAOF host port

Available since: 5.0.0.

Make the server a replica of another instance, or promote it as master..

REPLICAOF host port

Available since: 5.0.0.
sourceraw docstring

restoreclj

(restore key ttl serialized-value)
(restore key ttl serialized-value & args)

Create a key using the provided serialized value, previously obtained using DUMP..

RESTORE key ttl serialized-value [REPLACE] [ABSTTL] [IDLETIME seconds] [FREQ frequency]

Available since: 2.6.0.

Time complexity: O(1) to create the new key and additional O(NM) to reconstruct the serialized value, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1M) where M is small, so simply O(1). However for sorted set values the complexity is O(NMlog(N)) because inserting values into sorted sets is O(log(N)).

Create a key using the provided serialized value, previously obtained using DUMP..

RESTORE key ttl serialized-value [REPLACE] [ABSTTL] [IDLETIME seconds] [FREQ frequency]

Available since: 2.6.0.

Time complexity: O(1) to create the new key and additional O(N*M) to reconstruct the serialized value, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1). However for sorted set values the complexity is O(N*M*log(N)) because inserting values into sorted sets is O(log(N)).
sourceraw docstring

returnclj

Takes values and returns them as part of next reply from Redis server. Unlike echo, does not actually send any data to Redis.

Takes values and returns them as part of next reply from Redis server.
Unlike `echo`, does not actually send any data to Redis.
sourceraw docstring

roleclj

(role)

Return the role of the instance in the context of replication.

ROLE

Available since: 2.8.12.

Return the role of the instance in the context of replication.

ROLE 

Available since: 2.8.12.
sourceraw docstring

rpopclj

(rpop key)

Remove and get the last element in a list.

RPOP key

Available since: 1.0.0.

Time complexity: O(1)

Remove and get the last element in a list.

RPOP key

Available since: 1.0.0.

Time complexity: O(1)
sourceraw docstring

rpoplpushclj

(rpoplpush source destination)

Remove the last element in a list, prepend it to another list and return it.

RPOPLPUSH source destination

Available since: 1.2.0.

Time complexity: O(1)

Remove the last element in a list, prepend it to another list and return it.

RPOPLPUSH source destination

Available since: 1.2.0.

Time complexity: O(1)
sourceraw docstring

rpushclj

(rpush key element)
(rpush key element & args)

Append one or multiple elements to a list.

RPUSH key element [element ...]

Available since: 1.0.0.

Time complexity: O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.

Append one or multiple elements to a list.

RPUSH key element [element ...]

Available since: 1.0.0.

Time complexity: O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.
sourceraw docstring

rpushxclj

(rpushx key element)
(rpushx key element & args)

Append an element to a list, only if the list exists.

RPUSHX key element [element ...]

Available since: 2.2.0.

Time complexity: O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.

Append an element to a list, only if the list exists.

RPUSHX key element [element ...]

Available since: 2.2.0.

Time complexity: O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.
sourceraw docstring

saddclj

(sadd key member)
(sadd key member & args)

Add one or more members to a set.

SADD key member [member ...]

Available since: 1.0.0.

Time complexity: O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.

Add one or more members to a set.

SADD key member [member ...]

Available since: 1.0.0.

Time complexity: O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.
sourceraw docstring

saveclj

(save)

Synchronously save the dataset to disk.

SAVE

Available since: 1.0.0.

Synchronously save the dataset to disk.

SAVE 

Available since: 1.0.0.
sourceraw docstring

scanclj

(scan cursor)
(scan cursor & args)

Incrementally iterate the keys space.

SCAN cursor [MATCH pattern] [COUNT count] [TYPE type]

Available since: 2.8.0.

Time complexity: O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection.

Incrementally iterate the keys space.

SCAN cursor [MATCH pattern] [COUNT count] [TYPE type]

Available since: 2.8.0.

Time complexity: O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection.
sourceraw docstring

scardclj

(scard key)

Get the number of members in a set.

SCARD key

Available since: 1.0.0.

Time complexity: O(1)

Get the number of members in a set.

SCARD key

Available since: 1.0.0.

Time complexity: O(1)
sourceraw docstring

script-debugclj

(script-debug mode)

Set the debug mode for executed scripts..

SCRIPT DEBUG YES|SYNC|NO

Available since: 3.2.0.

Time complexity: O(1)

Set the debug mode for executed scripts..

SCRIPT DEBUG YES|SYNC|NO

Available since: 3.2.0.

Time complexity: O(1)
sourceraw docstring

script-existsclj

(script-exists sha1)
(script-exists sha1 & args)

Check existence of scripts in the script cache..

SCRIPT EXISTS sha1 [sha1 ...]

Available since: 2.6.0.

Time complexity: O(N) with N being the number of scripts to check (so checking a single script is an O(1) operation).

Check existence of scripts in the script cache..

SCRIPT EXISTS sha1 [sha1 ...]

Available since: 2.6.0.

Time complexity: O(N) with N being the number of scripts to check (so checking a single script is an O(1) operation).
sourceraw docstring

script-flushclj

(script-flush)

Remove all the scripts from the script cache..

SCRIPT FLUSH

Available since: 2.6.0.

Time complexity: O(N) with N being the number of scripts in cache

Remove all the scripts from the script cache..

SCRIPT FLUSH 

Available since: 2.6.0.

Time complexity: O(N) with N being the number of scripts in cache
sourceraw docstring

script-hashclj

source

script-killclj

(script-kill)

Kill the script currently in execution..

SCRIPT KILL

Available since: 2.6.0.

Time complexity: O(1)

Kill the script currently in execution..

SCRIPT KILL 

Available since: 2.6.0.

Time complexity: O(1)
sourceraw docstring

script-loadclj

(script-load script)

Load the specified Lua script into the script cache..

SCRIPT LOAD script

Available since: 2.6.0.

Time complexity: O(N) with N being the length in bytes of the script body.

Load the specified Lua script into the script cache..

SCRIPT LOAD script

Available since: 2.6.0.

Time complexity: O(N) with N being the length in bytes of the script body.
sourceraw docstring

sdiffclj

(sdiff key)
(sdiff key & args)

Subtract multiple sets.

SDIFF key [key ...]

Available since: 1.0.0.

Time complexity: O(N) where N is the total number of elements in all given sets.

Subtract multiple sets.

SDIFF key [key ...]

Available since: 1.0.0.

Time complexity: O(N) where N is the total number of elements in all given sets.
sourceraw docstring

sdiffstoreclj

(sdiffstore destination key)
(sdiffstore destination key & args)

Subtract multiple sets and store the resulting set in a key.

SDIFFSTORE destination key [key ...]

Available since: 1.0.0.

Time complexity: O(N) where N is the total number of elements in all given sets.

Subtract multiple sets and store the resulting set in a key.

SDIFFSTORE destination key [key ...]

Available since: 1.0.0.

Time complexity: O(N) where N is the total number of elements in all given sets.
sourceraw docstring

selectclj

(select index)

Change the selected database for the current connection.

SELECT index

Available since: 1.0.0.

Change the selected database for the current connection.

SELECT index

Available since: 1.0.0.
sourceraw docstring

serializeclj

DEPRECATED: Use freeze instead.

DEPRECATED: Use `freeze` instead.
sourceraw docstring

setclj

(set key value)
(set key value & args)

Set the string value of a key.

SET key value [EX seconds|PX milliseconds] [NX|XX]

Available since: 1.0.0.

Time complexity: O(1)

Set the string value of a key.

SET key value [EX seconds|PX milliseconds] [NX|XX]

Available since: 1.0.0.

Time complexity: O(1)
sourceraw docstring

setbitclj

(setbit key offset value)

Sets or clears the bit at offset in the string value stored at key.

SETBIT key offset value

Available since: 2.2.0.

Time complexity: O(1)

Sets or clears the bit at offset in the string value stored at key.

SETBIT key offset value

Available since: 2.2.0.

Time complexity: O(1)
sourceraw docstring

setexclj

(setex key seconds value)

Set the value and expiration of a key.

SETEX key seconds value

Available since: 2.0.0.

Time complexity: O(1)

Set the value and expiration of a key.

SETEX key seconds value

Available since: 2.0.0.

Time complexity: O(1)
sourceraw docstring

setnxclj

(setnx key value)

Set the value of a key, only if the key does not exist.

SETNX key value

Available since: 1.0.0.

Time complexity: O(1)

Set the value of a key, only if the key does not exist.

SETNX key value

Available since: 1.0.0.

Time complexity: O(1)
sourceraw docstring

setrangeclj

(setrange key offset value)

Overwrite part of a string at key starting at the specified offset.

SETRANGE key offset value

Available since: 2.2.0.

Time complexity: O(1), not counting the time taken to copy the new string in place. Usually, this string is very small so the amortized complexity is O(1). Otherwise, complexity is O(M) with M being the length of the value argument.

Overwrite part of a string at key starting at the specified offset.

SETRANGE key offset value

Available since: 2.2.0.

Time complexity: O(1), not counting the time taken to copy the new string in place. Usually, this string is very small so the amortized complexity is O(1). Otherwise, complexity is O(M) with M being the length of the value argument.
sourceraw docstring

shutdownclj

(shutdown)
(shutdown & args)

Synchronously save the dataset to disk and then shut down the server.

SHUTDOWN [NOSAVE|SAVE]

Available since: 1.0.0.

Synchronously save the dataset to disk and then shut down the server.

SHUTDOWN [NOSAVE|SAVE]

Available since: 1.0.0.
sourceraw docstring

sinterclj

(sinter key)
(sinter key & args)

Intersect multiple sets.

SINTER key [key ...]

Available since: 1.0.0.

Time complexity: O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets.

Intersect multiple sets.

SINTER key [key ...]

Available since: 1.0.0.

Time complexity: O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets.
sourceraw docstring

sinterstoreclj

(sinterstore destination key)
(sinterstore destination key & args)

Intersect multiple sets and store the resulting set in a key.

SINTERSTORE destination key [key ...]

Available since: 1.0.0.

Time complexity: O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets.

Intersect multiple sets and store the resulting set in a key.

SINTERSTORE destination key [key ...]

Available since: 1.0.0.

Time complexity: O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets.
sourceraw docstring

sismemberclj

(sismember key member)

Determine if a given value is a member of a set.

SISMEMBER key member

Available since: 1.0.0.

Time complexity: O(1)

Determine if a given value is a member of a set.

SISMEMBER key member

Available since: 1.0.0.

Time complexity: O(1)
sourceraw docstring

skip-repliescljmacro

DEPRECATED: Use with-replies instead.

DEPRECATED: Use `with-replies` instead.
sourceraw docstring

slaveofclj

(slaveof host port)

Make the server a replica of another instance, or promote it as master. Deprecated starting with Redis 5. Use REPLICAOF instead..

SLAVEOF host port

Available since: 1.0.0.

Make the server a replica of another instance, or promote it as master. Deprecated starting with Redis 5. Use REPLICAOF instead..

SLAVEOF host port

Available since: 1.0.0.
sourceraw docstring

slowlogclj

(slowlog subcommand)
(slowlog subcommand & args)

Manages the Redis slow queries log.

SLOWLOG subcommand [argument]

Available since: 2.2.12.

Manages the Redis slow queries log.

SLOWLOG subcommand [argument]

Available since: 2.2.12.
sourceraw docstring

smembersclj

(smembers key)

Get all the members in a set.

SMEMBERS key

Available since: 1.0.0.

Time complexity: O(N) where N is the set cardinality.

Get all the members in a set.

SMEMBERS key

Available since: 1.0.0.

Time complexity: O(N) where N is the set cardinality.
sourceraw docstring

smoveclj

(smove source destination member)

Move a member from one set to another.

SMOVE source destination member

Available since: 1.0.0.

Time complexity: O(1)

Move a member from one set to another.

SMOVE source destination member

Available since: 1.0.0.

Time complexity: O(1)
sourceraw docstring

sortclj

(sort key)
(sort key & args)

Sort the elements in a list, set or sorted set.

SORT key [BY pattern] [LIMIT offset count] [GET pattern [GET pattern ...]] [ASC|DESC] [ALPHA] [STORE destination]

Available since: 1.0.0.

Time complexity: O(N+M*log(M)) where N is the number of elements in the list or set to sort, and M the number of returned elements. When the elements are not sorted, complexity is currently O(N) as there is a copy step that will be avoided in next releases.

Sort the elements in a list, set or sorted set.

SORT key [BY pattern] [LIMIT offset count] [GET pattern [GET pattern ...]] [ASC|DESC] [ALPHA] [STORE destination]

Available since: 1.0.0.

Time complexity: O(N+M*log(M)) where N is the number of elements in the list or set to sort, and M the number of returned elements. When the elements are not sorted, complexity is currently O(N) as there is a copy step that will be avoided in next releases.
sourceraw docstring

sort*clj

(sort* key & sort-args)

Like sort but supports idiomatic Clojure arguments: :by pattern, :limit offset count, :get pattern, :mget patterns, :store destination, :alpha, :asc, :desc.

Like `sort` but supports idiomatic Clojure arguments: :by pattern,
:limit offset count, :get pattern, :mget patterns, :store destination,
:alpha, :asc, :desc.
sourceraw docstring

spopclj

(spop key)
(spop key & args)

Remove and return one or multiple random members from a set.

SPOP key [count]

Available since: 1.0.0.

Time complexity: O(1)

Remove and return one or multiple random members from a set.

SPOP key [count]

Available since: 1.0.0.

Time complexity: O(1)
sourceraw docstring

srandmemberclj

(srandmember key)
(srandmember key & args)

Get one or multiple random members from a set.

SRANDMEMBER key [count]

Available since: 1.0.0.

Time complexity: Without the count argument O(1), otherwise O(N) where N is the absolute value of the passed count.

Get one or multiple random members from a set.

SRANDMEMBER key [count]

Available since: 1.0.0.

Time complexity: Without the count argument O(1), otherwise O(N) where N is the absolute value of the passed count.
sourceraw docstring

sremclj

(srem key member)
(srem key member & args)

Remove one or more members from a set.

SREM key member [member ...]

Available since: 1.0.0.

Time complexity: O(N) where N is the number of members to be removed.

Remove one or more members from a set.

SREM key member [member ...]

Available since: 1.0.0.

Time complexity: O(N) where N is the number of members to be removed.
sourceraw docstring

sscanclj

(sscan key cursor)
(sscan key cursor & args)

Incrementally iterate Set elements.

SSCAN key cursor [MATCH pattern] [COUNT count]

Available since: 2.8.0.

Time complexity: O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection..

Incrementally iterate Set elements.

SSCAN key cursor [MATCH pattern] [COUNT count]

Available since: 2.8.0.

Time complexity: O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection..
sourceraw docstring

strlenclj

(strlen key)

Get the length of the value stored in a key.

STRLEN key

Available since: 2.2.0.

Time complexity: O(1)

Get the length of the value stored in a key.

STRLEN key

Available since: 2.2.0.

Time complexity: O(1)
sourceraw docstring

subscribeclj

(subscribe channel)
(subscribe channel & args)

Listen for messages published to the given channels.

SUBSCRIBE channel [channel ...]

Available since: 2.0.0.

Time complexity: O(N) where N is the number of channels to subscribe to.

Listen for messages published to the given channels.

SUBSCRIBE channel [channel ...]

Available since: 2.0.0.

Time complexity: O(N) where N is the number of channels to subscribe to.
sourceraw docstring

sunionclj

(sunion key)
(sunion key & args)

Add multiple sets.

SUNION key [key ...]

Available since: 1.0.0.

Time complexity: O(N) where N is the total number of elements in all given sets.

Add multiple sets.

SUNION key [key ...]

Available since: 1.0.0.

Time complexity: O(N) where N is the total number of elements in all given sets.
sourceraw docstring

sunionstoreclj

(sunionstore destination key)
(sunionstore destination key & args)

Add multiple sets and store the resulting set in a key.

SUNIONSTORE destination key [key ...]

Available since: 1.0.0.

Time complexity: O(N) where N is the total number of elements in all given sets.

Add multiple sets and store the resulting set in a key.

SUNIONSTORE destination key [key ...]

Available since: 1.0.0.

Time complexity: O(N) where N is the total number of elements in all given sets.
sourceraw docstring

swapclj

Experimental.

Experimental.
sourceraw docstring

swapdbclj

(swapdb index index)

Swaps two Redis databases.

SWAPDB index index

Available since: 4.0.0.

Swaps two Redis databases.

SWAPDB index index

Available since: 4.0.0.
sourceraw docstring

syncclj

(sync)

Internal command used for replication.

SYNC

Available since: 1.0.0.

Internal command used for replication.

SYNC 

Available since: 1.0.0.
sourceraw docstring

timeclj

(time)

Return the current server time.

TIME

Available since: 2.6.0.

Time complexity: O(1)

Return the current server time.

TIME 

Available since: 2.6.0.

Time complexity: O(1)
sourceraw docstring

touchclj

(touch key)
(touch key & args)

Alters the last access time of a key(s). Returns the number of existing keys specified..

TOUCH key [key ...]

Available since: 3.2.1.

Time complexity: O(N) where N is the number of keys that will be touched.

Alters the last access time of a key(s). Returns the number of existing keys specified..

TOUCH key [key ...]

Available since: 3.2.1.

Time complexity: O(N) where N is the number of keys that will be touched.
sourceraw docstring

ttlclj

(ttl key)

Get the time to live for a key.

TTL key

Available since: 1.0.0.

Time complexity: O(1)

Get the time to live for a key.

TTL key

Available since: 1.0.0.

Time complexity: O(1)
sourceraw docstring

typeclj

(type key)

Determine the type stored at key.

TYPE key

Available since: 1.0.0.

Time complexity: O(1)

Determine the type stored at key.

TYPE key

Available since: 1.0.0.

Time complexity: O(1)
sourceraw docstring

(unlink key)
(unlink key & args)

Delete a key asynchronously in another thread. Otherwise it is just as DEL, but non blocking..

UNLINK key [key ...]

Available since: 4.0.0.

Time complexity: O(1) for each key removed regardless of its size. Then the command does O(N) work in a different thread in order to reclaim memory, where N is the number of allocations the deleted objects where composed of.

Delete a key asynchronously in another thread. Otherwise it is just as DEL, but non blocking..

UNLINK key [key ...]

Available since: 4.0.0.

Time complexity: O(1) for each key removed regardless of its size. Then the command does O(N) work in a different thread in order to reclaim memory, where N is the number of allocations the deleted objects where composed of.
sourceraw docstring

unsubscribeclj

(unsubscribe)
(unsubscribe & args)

Stop listening for messages posted to the given channels.

UNSUBSCRIBE [channel [channel ...]]

Available since: 2.0.0.

Time complexity: O(N) where N is the number of clients already subscribed to a channel.

Stop listening for messages posted to the given channels.

UNSUBSCRIBE [channel [channel ...]]

Available since: 2.0.0.

Time complexity: O(N) where N is the number of clients already subscribed to a channel.
sourceraw docstring

unwatchclj

(unwatch)

Forget about all watched keys.

UNWATCH

Available since: 2.2.0.

Time complexity: O(1)

Forget about all watched keys.

UNWATCH 

Available since: 2.2.0.

Time complexity: O(1)
sourceraw docstring

waitclj

(wait numreplicas timeout)

Wait for the synchronous replication of all the write commands sent in the context of the current connection.

WAIT numreplicas timeout

Available since: 3.0.0.

Time complexity: O(1)

Wait for the synchronous replication of all the write commands sent in the context of the current connection.

WAIT numreplicas timeout

Available since: 3.0.0.

Time complexity: O(1)
sourceraw docstring

watchclj

(watch key)
(watch key & args)

Watch the given keys to determine execution of the MULTI/EXEC block.

WATCH key [key ...]

Available since: 2.2.0.

Time complexity: O(1) for every key.

Watch the given keys to determine execution of the MULTI/EXEC block.

WATCH key [key ...]

Available since: 2.2.0.

Time complexity: O(1) for every key.
sourceraw docstring

wcarcljmacro

(wcar conn-opts & body)
(wcar conn-opts :as-pipeline & body)

Evaluates body in the context of a fresh thread-bound pooled connection to Redis server. Sends Redis commands to server as pipeline and returns the server's response. Releases connection back to pool when done.

conn-opts arg is a map with connection pool and spec options, e.g.: {:pool {} :spec {:host "127.0.0.1" :port 6379}} ; Default {:pool :none :spec {:host "127.0.0.1" :port 6379}} ; No pool {:pool {} :spec {:uri "redis://redistogo:pass@panga.redistogo.com:9475/"}} {:pool {} :spec {:host "127.0.0.1" :port 6379 :ssl-fn :default ; [1] :password "secret" :timeout-ms 6000 :db 3}}

Note that because of thread-binding, you'll probably want to avoid lazy Redis command calls in wcar's body unless you know what you're doing. Compare: (wcar {} (for [k [:k1 :k2]] (car/set k :val)) ; Lazy, NO commands run (wcar {} (doseq [k [:k1 :k2]] (car/set k :val)) ; Not lazy, commands run

See also with-replies.

[1] Optional ssl-fn conn opt takes and returns a java.net.Socket: (fn [{:keys [^Socket socket host port]}]) -> ^Socket :default => use taoensso.carmine.connections/default-ssl-fn.

Evaluates body in the context of a fresh thread-bound pooled connection to
Redis server. Sends Redis commands to server as pipeline and returns the
server's response. Releases connection back to pool when done.

`conn-opts` arg is a map with connection pool and spec options, e.g.:
  {:pool {}    :spec {:host "127.0.0.1" :port 6379}} ; Default
  {:pool :none :spec {:host "127.0.0.1" :port 6379}} ; No pool
  {:pool {} :spec {:uri "redis://redistogo:pass@panga.redistogo.com:9475/"}}
  {:pool {} :spec {:host "127.0.0.1"
                   :port 6379
                   :ssl-fn :default ; [1]
                   :password "secret"
                   :timeout-ms 6000
                   :db 3}}

Note that because of thread-binding, you'll probably want to avoid lazy Redis
command calls in `wcar`'s body unless you know what you're doing. Compare:
`(wcar {} (for   [k [:k1 :k2]] (car/set k :val))` ; Lazy, NO commands run
`(wcar {} (doseq [k [:k1 :k2]] (car/set k :val))` ; Not lazy, commands run

See also `with-replies`.

[1] Optional `ssl-fn` conn opt takes and returns a `java.net.Socket`:
  (fn [{:keys [^Socket socket host port]}]) -> ^Socket
  `:default` => use `taoensso.carmine.connections/default-ssl-fn`.
sourceraw docstring

with-conncljmacro

(with-conn connection-pool connection-spec & body)

DEPRECATED: Use wcar instead.

DEPRECATED: Use `wcar` instead.
sourceraw docstring

with-new-listenercljmacro

(with-new-listener conn-spec handler initial-state & body)

Creates a persistent[1] connection to Redis server and a thread to listen for server messages on that connection.

Incoming messages will be dispatched (along with current listener state) to (fn handler [reply state-atom]).

Evaluates body within the context of the connection and returns a general-purpose Listener containing:

  1. The underlying persistent connection to facilitate close-listener and with-open-listener.
  2. An atom containing the function given to handle incoming server messages.
  3. An atom containing any other optional listener state.

Useful for Pub/Sub, monitoring, etc.

[1] You probably do NOT want a :timeout for your conn-spec here.

Creates a persistent[1] connection to Redis server and a thread to listen for
server messages on that connection.

Incoming messages will be dispatched (along with current listener state) to
(fn handler [reply state-atom]).

Evaluates body within the context of the connection and returns a
general-purpose Listener containing:
  1. The underlying persistent connection to facilitate `close-listener` and
     `with-open-listener`.
  2. An atom containing the function given to handle incoming server messages.
  3. An atom containing any other optional listener state.

Useful for Pub/Sub, monitoring, etc.

[1] You probably do *NOT* want a :timeout for your `conn-spec` here.
sourceraw docstring

with-new-pubsub-listenercljmacro

(with-new-pubsub-listener conn-spec message-handlers & subscription-commands)

A wrapper for with-new-listener.

Creates a persistent[1] connection to Redis server and a thread to handle messages published to channels that you subscribe to with subscribe/psubscribe calls in body.

Handlers will receive messages of form: [<msg-type> <channel/pattern> <message-content>].

(with-new-pubsub-listener {} ; Connection spec, as per wcar docstring [1] {"channel1" (fn [[type match content :as msg]] (prn "Channel match: " msg)) "user*" (fn [[type match content :as msg]] (prn "Pattern match: " msg))} (subscribe "foobar") ; Subscribe thread conn to "foobar" channel (psubscribe "foo*") ; Subscribe thread conn to "foo*" channel pattern )

Returns the Listener to allow manual closing and adjustments to message-handlers.

[1] You probably do NOT want a :timeout for your conn-spec here.

A wrapper for `with-new-listener`.

Creates a persistent[1] connection to Redis server and a thread to
handle messages published to channels that you subscribe to with
`subscribe`/`psubscribe` calls in body.

Handlers will receive messages of form:
  [<msg-type> <channel/pattern> <message-content>].

(with-new-pubsub-listener
  {} ; Connection spec, as per `wcar` docstring [1]
  {"channel1" (fn [[type match content :as msg]] (prn "Channel match: " msg))
   "user*"    (fn [[type match content :as msg]] (prn "Pattern match: " msg))}
  (subscribe "foobar") ; Subscribe thread conn to "foobar" channel
  (psubscribe "foo*")  ; Subscribe thread conn to "foo*" channel pattern
 )

Returns the Listener to allow manual closing and adjustments to
message-handlers.

[1] You probably do *NOT* want a :timeout for your `conn-spec` here.
sourceraw docstring

with-open-listenercljmacro

(with-open-listener listener & body)

Evaluates body within the context of given listener's preexisting persistent connection.

Evaluates body within the context of given listener's preexisting persistent
connection.
sourceraw docstring

with-parsercljmacro

DEPRECATED: Use parse instead.

DEPRECATED: Use `parse` instead.
sourceraw docstring

with-repliescljmacro

(with-replies & body)
(with-replies :as-pipeline & body)

Alpha - subject to change. Evaluates body, immediately returning the server's response to any contained Redis commands (i.e. before enclosing context ends).

As an implementation detail, stashes and then returns any replies already queued with Redis server: i.e. should be compatible with pipelining.

Note on parsers: if you're writing a Redis command (e.g. a fn that is intended to execute w/in an implicit connection context) and you're using with-replies as an implementation detail (i.e. you're interpreting replies internally), you probably want (parse nil (with-replies ...)) to keep external parsers from leaking into your internal logic.

Alpha - subject to change.
Evaluates body, immediately returning the server's response to any
contained Redis commands (i.e. before enclosing context ends).

As an implementation detail, stashes and then `return`s any replies already
queued with Redis server: i.e. should be compatible with pipelining.

Note on parsers: if you're writing a Redis command (e.g. a fn that is
intended to execute w/in an implicit connection context) and you're using
`with-replies` as an implementation detail (i.e. you're interpreting
replies internally), you probably want `(parse nil (with-replies ...))` to
keep external parsers from leaking into your internal logic.
sourceraw docstring

with-replycljmacro

DEPRECATED: Use with-replies instead.

DEPRECATED: Use `with-replies` instead.
sourceraw docstring

with-thaw-optscljmacro

(with-thaw-opts opts & body)
source

xackclj

(xack key group ID)
(xack key group ID & args)

Marks a pending message as correctly processed, effectively removing it from the pending entries list of the consumer group. Return value of the command is the number of messages successfully acknowledged, that is, the IDs we were actually able to resolve in the PEL..

XACK key group ID [ID ...]

Available since: 5.0.0.

Time complexity: O(1) for each message ID processed.

Marks a pending message as correctly processed, effectively removing it from the pending entries list of the consumer group. Return value of the command is the number of messages successfully acknowledged, that is, the IDs we were actually able to resolve in the PEL..

XACK key group ID [ID ...]

Available since: 5.0.0.

Time complexity: O(1) for each message ID processed.
sourceraw docstring

xaddclj

(xadd key ID field value)
(xadd key ID field value & args)

Appends a new entry to a stream.

XADD key ID field value [field value ...]

Available since: 5.0.0.

Time complexity: O(1)

Appends a new entry to a stream.

XADD key ID field value [field value ...]

Available since: 5.0.0.

Time complexity: O(1)
sourceraw docstring

xclaimclj

(xclaim key group consumer min-idle-time ID)
(xclaim key group consumer min-idle-time ID & args)

Changes (or acquires) ownership of a message in a consumer group, as if the message was delivered to the specified consumer..

XCLAIM key group consumer min-idle-time ID [ID ...] [IDLE ms] [TIME ms-unix-time] [RETRYCOUNT count] [FORCE] [JUSTID]

Available since: 5.0.0.

Time complexity: O(log N) with N being the number of messages in the PEL of the consumer group.

Changes (or acquires) ownership of a message in a consumer group, as if the message was delivered to the specified consumer..

XCLAIM key group consumer min-idle-time ID [ID ...] [IDLE ms] [TIME ms-unix-time] [RETRYCOUNT count] [FORCE] [JUSTID]

Available since: 5.0.0.

Time complexity: O(log N) with N being the number of messages in the PEL of the consumer group.
sourceraw docstring

xdelclj

(xdel key ID)
(xdel key ID & args)

Removes the specified entries from the stream. Returns the number of items actually deleted, that may be different from the number of IDs passed in case certain IDs do not exist..

XDEL key ID [ID ...]

Available since: 5.0.0.

Time complexity: O(1) for each single item to delete in the stream, regardless of the stream size.

Removes the specified entries from the stream. Returns the number of items actually deleted, that may be different from the number of IDs passed in case certain IDs do not exist..

XDEL key ID [ID ...]

Available since: 5.0.0.

Time complexity: O(1) for each single item to delete in the stream, regardless of the stream size.
sourceraw docstring

xgroupclj

(xgroup)
(xgroup & args)

Create, destroy, and manage consumer groups..

XGROUP [CREATE key groupname id-or-$] [SETID key groupname id-or-$] [DESTROY key groupname] [DELCONSUMER key groupname consumername]

Available since: 5.0.0.

Time complexity: O(1) for all the subcommands, with the exception of the DESTROY subcommand which takes an additional O(M) time in order to delete the M entries inside the consumer group pending entries list (PEL).

Create, destroy, and manage consumer groups..

XGROUP [CREATE key groupname id-or-$] [SETID key groupname id-or-$] [DESTROY key groupname] [DELCONSUMER key groupname consumername]

Available since: 5.0.0.

Time complexity: O(1) for all the subcommands, with the exception of the DESTROY subcommand which takes an additional O(M) time in order to delete the M entries inside the consumer group pending entries list (PEL).
sourceraw docstring

xinfoclj

(xinfo)
(xinfo & args)

Get information on streams and consumer groups.

XINFO [CONSUMERS key groupname] [GROUPS key] [STREAM key] [HELP]

Available since: 5.0.0.

Time complexity: O(N) with N being the number of returned items for the subcommands CONSUMERS and GROUPS. The STREAM subcommand is O(log N) with N being the number of items in the stream.

Get information on streams and consumer groups.

XINFO [CONSUMERS key groupname] [GROUPS key] [STREAM key] [HELP]

Available since: 5.0.0.

Time complexity: O(N) with N being the number of returned items for the subcommands CONSUMERS and GROUPS. The STREAM subcommand is O(log N) with N being the number of items in the stream.
sourceraw docstring

xlenclj

(xlen key)

Return the number of entires in a stream.

XLEN key

Available since: 5.0.0.

Time complexity: O(1)

Return the number of entires in a stream.

XLEN key

Available since: 5.0.0.

Time complexity: O(1)
sourceraw docstring

xpendingclj

(xpending key group)
(xpending key group & args)

Return information and entries from a stream consumer group pending entries list, that are messages fetched but never acknowledged..

XPENDING key group [start end count] [consumer]

Available since: 5.0.0.

Time complexity: O(N) with N being the number of elements returned, so asking for a small fixed number of entries per call is O(1). When the command returns just the summary it runs in O(1) time assuming the list of consumers is small, otherwise there is additional O(N) time needed to iterate every consumer.

Return information and entries from a stream consumer group pending entries list, that are messages fetched but never acknowledged..

XPENDING key group [start end count] [consumer]

Available since: 5.0.0.

Time complexity: O(N) with N being the number of elements returned, so asking for a small fixed number of entries per call is O(1). When the command returns just the summary it runs in O(1) time assuming the list of consumers is small, otherwise there is additional O(N) time needed to iterate every consumer.
sourceraw docstring

xrangeclj

(xrange key start end)
(xrange key start end & args)

Return a range of elements in a stream, with IDs matching the specified IDs interval.

XRANGE key start end [COUNT count]

Available since: 5.0.0.

Time complexity: O(N) with N being the number of elements being returned. If N is constant (e.g. always asking for the first 10 elements with COUNT), you can consider it O(1).

Return a range of elements in a stream, with IDs matching the specified IDs interval.

XRANGE key start end [COUNT count]

Available since: 5.0.0.

Time complexity: O(N) with N being the number of elements being returned. If N is constant (e.g. always asking for the first 10 elements with COUNT), you can consider it O(1).
sourceraw docstring

xreadclj

(xread)
(xread & args)

Return never seen elements in multiple streams, with IDs greater than the ones reported by the caller for each stream. Can block..

XREAD [COUNT count] [BLOCK milliseconds] STREAMS key [key ...] id [id ...]

Available since: 5.0.0.

Time complexity: For each stream mentioned: O(N) with N being the number of elements being returned, it means that XREAD-ing with a fixed COUNT is O(1). Note that when the BLOCK option is used, XADD will pay O(M) time in order to serve the M clients blocked on the stream getting new data.

Return never seen elements in multiple streams, with IDs greater than the ones reported by the caller for each stream. Can block..

XREAD [COUNT count] [BLOCK milliseconds] STREAMS key [key ...] id [id ...]

Available since: 5.0.0.

Time complexity: For each stream mentioned: O(N) with N being the number of elements being returned, it means that XREAD-ing with a fixed COUNT is O(1). Note that when the BLOCK option is used, XADD will pay O(M) time in order to serve the M clients blocked on the stream getting new data.
sourceraw docstring

xreadgroupclj

(xreadgroup group consumer)
(xreadgroup group consumer & args)

Return new entries from a stream using a consumer group, or access the history of the pending entries for a given consumer. Can block..

XREADGROUP GROUP group consumer [COUNT count] [BLOCK milliseconds] [NOACK] STREAMS key [key ...] ID [ID ...]

Available since: 5.0.0.

Time complexity: For each stream mentioned: O(M) with M being the number of elements returned. If M is constant (e.g. always asking for the first 10 elements with COUNT), you can consider it O(1). On the other side when XREADGROUP blocks, XADD will pay the O(N) time in order to serve the N clients blocked on the stream getting new data.

Return new entries from a stream using a consumer group, or access the history of the pending entries for a given consumer. Can block..

XREADGROUP GROUP group consumer [COUNT count] [BLOCK milliseconds] [NOACK] STREAMS key [key ...] ID [ID ...]

Available since: 5.0.0.

Time complexity: For each stream mentioned: O(M) with M being the number of elements returned. If M is constant (e.g. always asking for the first 10 elements with COUNT), you can consider it O(1). On the other side when XREADGROUP blocks, XADD will pay the O(N) time in order to serve the N clients blocked on the stream getting new data.
sourceraw docstring

xrevrangeclj

(xrevrange key end start)
(xrevrange key end start & args)

Return a range of elements in a stream, with IDs matching the specified IDs interval, in reverse order (from greater to smaller IDs) compared to XRANGE.

XREVRANGE key end start [COUNT count]

Available since: 5.0.0.

Time complexity: O(N) with N being the number of elements returned. If N is constant (e.g. always asking for the first 10 elements with COUNT), you can consider it O(1).

Return a range of elements in a stream, with IDs matching the specified IDs interval, in reverse order (from greater to smaller IDs) compared to XRANGE.

XREVRANGE key end start [COUNT count]

Available since: 5.0.0.

Time complexity: O(N) with N being the number of elements returned. If N is constant (e.g. always asking for the first 10 elements with COUNT), you can consider it O(1).
sourceraw docstring

xtrimclj

(xtrim key strategy)
(xtrim key strategy & args)

Trims the stream to (approximately if '~' is passed) a certain size.

XTRIM key MAXLEN [~] count

Available since: 5.0.0.

Time complexity: O(N), with N being the number of evicted entries. Constant times are very small however, since entries are organized in macro nodes containing multiple entries that can be released with a single deallocation.

Trims the stream to (approximately if '~' is passed) a certain size.

XTRIM key MAXLEN [~] count

Available since: 5.0.0.

Time complexity: O(N), with N being the number of evicted entries. Constant times are very small however, since entries are organized in macro nodes containing multiple entries that can be released with a single deallocation.
sourceraw docstring

zaddclj

(zadd key)
(zadd key & args)

Add one or more members to a sorted set, or update its score if it already exists.

ZADD key [NX|XX] [CH] [INCR] score member [score member ...]

Available since: 1.2.0.

Time complexity: O(log(N)) for each item added, where N is the number of elements in the sorted set.

Add one or more members to a sorted set, or update its score if it already exists.

ZADD key [NX|XX] [CH] [INCR] score member [score member ...]

Available since: 1.2.0.

Time complexity: O(log(N)) for each item added, where N is the number of elements in the sorted set.
sourceraw docstring

zcardclj

(zcard key)

Get the number of members in a sorted set.

ZCARD key

Available since: 1.2.0.

Time complexity: O(1)

Get the number of members in a sorted set.

ZCARD key

Available since: 1.2.0.

Time complexity: O(1)
sourceraw docstring

zcountclj

(zcount key min max)

Count the members in a sorted set with scores within the given values.

ZCOUNT key min max

Available since: 2.0.0.

Time complexity: O(log(N)) with N being the number of elements in the sorted set.

Count the members in a sorted set with scores within the given values.

ZCOUNT key min max

Available since: 2.0.0.

Time complexity: O(log(N)) with N being the number of elements in the sorted set.
sourceraw docstring

zincrbyclj

(zincrby key increment member)

Increment the score of a member in a sorted set.

ZINCRBY key increment member

Available since: 1.2.0.

Time complexity: O(log(N)) where N is the number of elements in the sorted set.

Increment the score of a member in a sorted set.

ZINCRBY key increment member

Available since: 1.2.0.

Time complexity: O(log(N)) where N is the number of elements in the sorted set.
sourceraw docstring

zinterstoreclj

(zinterstore destination numkeys key)
(zinterstore destination numkeys key & args)

Intersect multiple sorted sets and store the resulting sorted set in a new key.

ZINTERSTORE destination numkeys key [key ...] [WEIGHTS weight] [AGGREGATE SUM|MIN|MAX]

Available since: 2.0.0.

Time complexity: O(NK)+O(Mlog(M)) worst case with N being the smallest input sorted set, K being the number of input sorted sets and M being the number of elements in the resulting sorted set.

Intersect multiple sorted sets and store the resulting sorted set in a new key.

ZINTERSTORE destination numkeys key [key ...] [WEIGHTS weight] [AGGREGATE SUM|MIN|MAX]

Available since: 2.0.0.

Time complexity: O(N*K)+O(M*log(M)) worst case with N being the smallest input sorted set, K being the number of input sorted sets and M being the number of elements in the resulting sorted set.
sourceraw docstring

zinterstore*clj

(zinterstore* dest-key source-keys & opts)

Like zinterstore but automatically counts keys.

Like `zinterstore` but automatically counts keys.
sourceraw docstring

zlexcountclj

(zlexcount key min max)

Count the number of members in a sorted set between a given lexicographical range.

ZLEXCOUNT key min max

Available since: 2.8.9.

Time complexity: O(log(N)) with N being the number of elements in the sorted set.

Count the number of members in a sorted set between a given lexicographical range.

ZLEXCOUNT key min max

Available since: 2.8.9.

Time complexity: O(log(N)) with N being the number of elements in the sorted set.
sourceraw docstring

zpopmaxclj

(zpopmax key)
(zpopmax key & args)

Remove and return members with the highest scores in a sorted set.

ZPOPMAX key [count]

Available since: 5.0.0.

Time complexity: O(log(N)*M) with N being the number of elements in the sorted set, and M being the number of elements popped.

Remove and return members with the highest scores in a sorted set.

ZPOPMAX key [count]

Available since: 5.0.0.

Time complexity: O(log(N)*M) with N being the number of elements in the sorted set, and M being the number of elements popped.
sourceraw docstring

zpopminclj

(zpopmin key)
(zpopmin key & args)

Remove and return members with the lowest scores in a sorted set.

ZPOPMIN key [count]

Available since: 5.0.0.

Time complexity: O(log(N)*M) with N being the number of elements in the sorted set, and M being the number of elements popped.

Remove and return members with the lowest scores in a sorted set.

ZPOPMIN key [count]

Available since: 5.0.0.

Time complexity: O(log(N)*M) with N being the number of elements in the sorted set, and M being the number of elements popped.
sourceraw docstring

zrangeclj

(zrange key start stop)
(zrange key start stop & args)

Return a range of members in a sorted set, by index.

ZRANGE key start stop [WITHSCORES]

Available since: 1.2.0.

Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements returned.

Return a range of members in a sorted set, by index.

ZRANGE key start stop [WITHSCORES]

Available since: 1.2.0.

Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements returned.
sourceraw docstring

zrangebylexclj

(zrangebylex key min max)
(zrangebylex key min max & args)

Return a range of members in a sorted set, by lexicographical range.

ZRANGEBYLEX key min max [LIMIT offset count]

Available since: 2.8.9.

Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)).

Return a range of members in a sorted set, by lexicographical range.

ZRANGEBYLEX key min max [LIMIT offset count]

Available since: 2.8.9.

Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)).
sourceraw docstring

zrangebyscoreclj

(zrangebyscore key min max)
(zrangebyscore key min max & args)

Return a range of members in a sorted set, by score.

ZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count]

Available since: 1.0.5.

Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)).

Return a range of members in a sorted set, by score.

ZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count]

Available since: 1.0.5.

Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)).
sourceraw docstring

zrankclj

(zrank key member)

Determine the index of a member in a sorted set.

ZRANK key member

Available since: 2.0.0.

Time complexity: O(log(N))

Determine the index of a member in a sorted set.

ZRANK key member

Available since: 2.0.0.

Time complexity: O(log(N))
sourceraw docstring

zremclj

(zrem key member)
(zrem key member & args)

Remove one or more members from a sorted set.

ZREM key member [member ...]

Available since: 1.2.0.

Time complexity: O(M*log(N)) with N being the number of elements in the sorted set and M the number of elements to be removed.

Remove one or more members from a sorted set.

ZREM key member [member ...]

Available since: 1.2.0.

Time complexity: O(M*log(N)) with N being the number of elements in the sorted set and M the number of elements to be removed.
sourceraw docstring

zremrangebylexclj

(zremrangebylex key min max)

Remove all members in a sorted set between the given lexicographical range.

ZREMRANGEBYLEX key min max

Available since: 2.8.9.

Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements removed by the operation.

Remove all members in a sorted set between the given lexicographical range.

ZREMRANGEBYLEX key min max

Available since: 2.8.9.

Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements removed by the operation.
sourceraw docstring

zremrangebyrankclj

(zremrangebyrank key start stop)

Remove all members in a sorted set within the given indexes.

ZREMRANGEBYRANK key start stop

Available since: 2.0.0.

Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements removed by the operation.

Remove all members in a sorted set within the given indexes.

ZREMRANGEBYRANK key start stop

Available since: 2.0.0.

Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements removed by the operation.
sourceraw docstring

zremrangebyscoreclj

(zremrangebyscore key min max)

Remove all members in a sorted set within the given scores.

ZREMRANGEBYSCORE key min max

Available since: 1.2.0.

Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements removed by the operation.

Remove all members in a sorted set within the given scores.

ZREMRANGEBYSCORE key min max

Available since: 1.2.0.

Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements removed by the operation.
sourceraw docstring

zrevrangeclj

(zrevrange key start stop)
(zrevrange key start stop & args)

Return a range of members in a sorted set, by index, with scores ordered from high to low.

ZREVRANGE key start stop [WITHSCORES]

Available since: 1.2.0.

Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements returned.

Return a range of members in a sorted set, by index, with scores ordered from high to low.

ZREVRANGE key start stop [WITHSCORES]

Available since: 1.2.0.

Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements returned.
sourceraw docstring

zrevrangebylexclj

(zrevrangebylex key max min)
(zrevrangebylex key max min & args)

Return a range of members in a sorted set, by lexicographical range, ordered from higher to lower strings..

ZREVRANGEBYLEX key max min [LIMIT offset count]

Available since: 2.8.9.

Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)).

Return a range of members in a sorted set, by lexicographical range, ordered from higher to lower strings..

ZREVRANGEBYLEX key max min [LIMIT offset count]

Available since: 2.8.9.

Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)).
sourceraw docstring

zrevrangebyscoreclj

(zrevrangebyscore key max min)
(zrevrangebyscore key max min & args)

Return a range of members in a sorted set, by score, with scores ordered from high to low.

ZREVRANGEBYSCORE key max min [WITHSCORES] [LIMIT offset count]

Available since: 2.2.0.

Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)).

Return a range of members in a sorted set, by score, with scores ordered from high to low.

ZREVRANGEBYSCORE key max min [WITHSCORES] [LIMIT offset count]

Available since: 2.2.0.

Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)).
sourceraw docstring

zrevrankclj

(zrevrank key member)

Determine the index of a member in a sorted set, with scores ordered from high to low.

ZREVRANK key member

Available since: 2.0.0.

Time complexity: O(log(N))

Determine the index of a member in a sorted set, with scores ordered from high to low.

ZREVRANK key member

Available since: 2.0.0.

Time complexity: O(log(N))
sourceraw docstring

zscanclj

(zscan key cursor)
(zscan key cursor & args)

Incrementally iterate sorted sets elements and associated scores.

ZSCAN key cursor [MATCH pattern] [COUNT count]

Available since: 2.8.0.

Time complexity: O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection..

Incrementally iterate sorted sets elements and associated scores.

ZSCAN key cursor [MATCH pattern] [COUNT count]

Available since: 2.8.0.

Time complexity: O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection..
sourceraw docstring

zscoreclj

(zscore key member)

Get the score associated with the given member in a sorted set.

ZSCORE key member

Available since: 1.2.0.

Time complexity: O(1)

Get the score associated with the given member in a sorted set.

ZSCORE key member

Available since: 1.2.0.

Time complexity: O(1)
sourceraw docstring

zunionstoreclj

(zunionstore destination numkeys key)
(zunionstore destination numkeys key & args)

Add multiple sorted sets and store the resulting sorted set in a new key.

ZUNIONSTORE destination numkeys key [key ...] [WEIGHTS weight] [AGGREGATE SUM|MIN|MAX]

Available since: 2.0.0.

Time complexity: O(N)+O(M log(M)) with N being the sum of the sizes of the input sorted sets, and M being the number of elements in the resulting sorted set.

Add multiple sorted sets and store the resulting sorted set in a new key.

ZUNIONSTORE destination numkeys key [key ...] [WEIGHTS weight] [AGGREGATE SUM|MIN|MAX]

Available since: 2.0.0.

Time complexity: O(N)+O(M log(M)) with N being the sum of the sizes of the input sorted sets, and M being the number of elements in the resulting sorted set.
sourceraw docstring

zunionstore*clj

(zunionstore* dest-key source-keys & opts)

Like zunionstore but automatically counts keys.

Like `zunionstore` but automatically counts keys.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close