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 key value

Append a value to a key.

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 key value

Append a value to a key.

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.
raw docstring

as-boolclj

(as-bool x)

as-doubleclj

DEPRECATED: Use as-float instead.

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

as-floatclj

(as-float x)

as-intclj

(as-int x)

as-longclj

DEPRECATED: Use as-int instead.

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

as-mapclj

(as-map x)

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.
raw 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.
raw docstring

atomicallycljmacro

(atomically watch-keys & body)

DEPRECATED: Use atomic instead.

DEPRECATED: Use `atomic` instead.
raw docstring

authclj

(auth password)

AUTH password

Authenticate to the server.

Available since: 1.0.0.

Time complexity:

AUTH password

Authenticate to the server.

Available since: 1.0.0.

Time complexity: 
raw docstring

bgrewriteaofclj

(bgrewriteaof)

BGREWRITEAOF

Asynchronously rewrite the append-only file.

Available since: 1.0.0.

Time complexity:

BGREWRITEAOF 

Asynchronously rewrite the append-only file.

Available since: 1.0.0.

Time complexity: 
raw docstring

bgsaveclj

(bgsave)

BGSAVE

Asynchronously save the dataset to disk.

Available since: 1.0.0.

Time complexity:

BGSAVE 

Asynchronously save the dataset to disk.

Available since: 1.0.0.

Time complexity: 
raw docstring

bitcountclj

(bitcount key & args)

BITCOUNT key [["start" "end"]]

Count set bits in a string.

Available since: 2.6.0.

Time complexity: O(N)

BITCOUNT key [["start" "end"]]

Count set bits in a string.

Available since: 2.6.0.

Time complexity: O(N)
raw docstring

bitopclj

(bitop operation destkey key & args)

BITOP operation destkey key [key ...]

Perform bitwise operations between strings.

Available since: 2.6.0.

Time complexity: O(N)

BITOP operation destkey key [key ...]

Perform bitwise operations between strings.

Available since: 2.6.0.

Time complexity: O(N)
raw docstring

bitposclj

(bitpos key bit & args)

BITPOS key bit [start] [end]

Find first bit set or clear in a string.

Available since: 2.8.7.

Time complexity: O(N)

BITPOS key bit [start] [end]

Find first bit set or clear in a string.

Available since: 2.8.7.

Time complexity: O(N)
raw docstring

blpopclj

(blpop key & args)

BLPOP key [key ...] timeout

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

Available since: 2.0.0.

Time complexity: O(1)

BLPOP key [key ...] timeout

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

Available since: 2.0.0.

Time complexity: O(1)
raw docstring

brpopclj

(brpop key & args)

BRPOP key [key ...] timeout

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

Available since: 2.0.0.

Time complexity: O(1)

BRPOP key [key ...] timeout

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

Available since: 2.0.0.

Time complexity: O(1)
raw docstring

brpoplpushclj

(brpoplpush source destination timeout)

BRPOPLPUSH source destination timeout

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

Available since: 2.2.0.

Time complexity: O(1)

BRPOPLPUSH source destination timeout

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

Available since: 2.2.0.

Time complexity: O(1)
raw docstring

client-getnameclj

(client-getname)

CLIENT GETNAME

Get the current connection name.

Available since: 2.6.9.

Time complexity: O(1)

CLIENT GETNAME 

Get the current connection name.

Available since: 2.6.9.

Time complexity: O(1)
raw docstring

client-killclj

(client-kill & args)

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

Kill the connection of a client.

Available since: 2.4.0.

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

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

Kill the connection of a client.

Available since: 2.4.0.

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

client-listclj

(client-list)

CLIENT LIST

Get the list of client connections.

Available since: 2.4.0.

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

CLIENT LIST 

Get the list of client connections.

Available since: 2.4.0.

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

client-pauseclj

(client-pause timeout)

CLIENT PAUSE timeout

Stop processing commands from clients for some time.

Available since: 2.9.50.

Time complexity: O(1)

CLIENT PAUSE timeout

Stop processing commands from clients for some time.

Available since: 2.9.50.

Time complexity: O(1)
raw docstring

client-setnameclj

(client-setname connection-name)

CLIENT SETNAME connection-name

Set the current connection name.

Available since: 2.6.9.

Time complexity: O(1)

CLIENT SETNAME connection-name

Set the current connection name.

Available since: 2.6.9.

Time complexity: O(1)
raw docstring

close-listenerclj

(close-listener listener)

cluster-addslotsclj

(cluster-addslots slot & args)

CLUSTER ADDSLOTS slot [slot ...]

Assign new hash slots to receiving node.

Available since: 3.0.0.

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

CLUSTER ADDSLOTS slot [slot ...]

Assign new hash slots to receiving node.

Available since: 3.0.0.

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

cluster-count-failure-reportsclj

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

CLUSTER COUNT-FAILURE-REPORTS node-id

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

Available since: 3.0.0.

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

CLUSTER COUNT-FAILURE-REPORTS node-id

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

Available since: 3.0.0.

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

cluster-countkeysinslotclj

(cluster-countkeysinslot slot)

CLUSTER COUNTKEYSINSLOT slot

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

Available since: 3.0.0.

Time complexity: O(1)

CLUSTER COUNTKEYSINSLOT slot

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

Available since: 3.0.0.

Time complexity: O(1)
raw docstring

cluster-delslotsclj

(cluster-delslots slot & args)

CLUSTER DELSLOTS slot [slot ...]

Set hash slots as unbound in receiving node.

Available since: 3.0.0.

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

CLUSTER DELSLOTS slot [slot ...]

Set hash slots as unbound in receiving node.

Available since: 3.0.0.

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

cluster-failoverclj

(cluster-failover & args)

CLUSTER FAILOVER [FORCE|TAKEOVER]

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

Available since: 3.0.0.

Time complexity: O(1)

CLUSTER FAILOVER [FORCE|TAKEOVER]

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

Available since: 3.0.0.

Time complexity: O(1)
raw docstring

cluster-forgetclj

(cluster-forget node-id)

CLUSTER FORGET node-id

Remove a node from the nodes table.

Available since: 3.0.0.

Time complexity: O(1)

CLUSTER FORGET node-id

Remove a node from the nodes table.

Available since: 3.0.0.

Time complexity: O(1)
raw docstring

cluster-getkeysinslotclj

(cluster-getkeysinslot slot count)

CLUSTER GETKEYSINSLOT slot count

Return local key names in the specified hash slot.

Available since: 3.0.0.

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

CLUSTER GETKEYSINSLOT slot count

Return local key names in the specified hash slot.

Available since: 3.0.0.

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

cluster-infoclj

(cluster-info)

CLUSTER INFO

Provides info about Redis Cluster node state.

Available since: 3.0.0.

Time complexity: O(1)

CLUSTER INFO 

Provides info about Redis Cluster node state.

Available since: 3.0.0.

Time complexity: O(1)
raw docstring

cluster-keyslotclj

(cluster-keyslot key)

CLUSTER KEYSLOT key

Returns the hash slot of the specified key.

Available since: 3.0.0.

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

CLUSTER KEYSLOT key

Returns the hash slot of the specified key.

Available since: 3.0.0.

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

cluster-meetclj

(cluster-meet ip port)

CLUSTER MEET ip port

Force a node cluster to handshake with another node.

Available since: 3.0.0.

Time complexity: O(1)

CLUSTER MEET ip port

Force a node cluster to handshake with another node.

Available since: 3.0.0.

Time complexity: O(1)
raw docstring

cluster-nodesclj

(cluster-nodes)

CLUSTER NODES

Get Cluster config for the node.

Available since: 3.0.0.

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

CLUSTER NODES 

Get Cluster config for the node.

Available since: 3.0.0.

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

cluster-replicateclj

(cluster-replicate node-id)

CLUSTER REPLICATE node-id

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

Available since: 3.0.0.

Time complexity: O(1)

CLUSTER REPLICATE node-id

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

Available since: 3.0.0.

Time complexity: O(1)
raw docstring

cluster-resetclj

(cluster-reset & args)

CLUSTER RESET [HARD|SOFT]

Reset a Redis Cluster node.

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.

CLUSTER RESET [HARD|SOFT]

Reset a Redis Cluster node.

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.
raw docstring

cluster-saveconfigclj

(cluster-saveconfig)

CLUSTER SAVECONFIG

Forces the node to save cluster state on disk.

Available since: 3.0.0.

Time complexity: O(1)

CLUSTER SAVECONFIG 

Forces the node to save cluster state on disk.

Available since: 3.0.0.

Time complexity: O(1)
raw docstring

cluster-set-config-epochclj

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

CLUSTER SET-CONFIG-EPOCH config-epoch

Set the configuration epoch in a new node.

Available since: 3.0.0.

Time complexity: O(1)

CLUSTER SET-CONFIG-EPOCH config-epoch

Set the configuration epoch in a new node.

Available since: 3.0.0.

Time complexity: O(1)
raw docstring

cluster-setslotclj

(cluster-setslot slot subcommand & args)

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

Bind an hash slot to a specific node.

Available since: 3.0.0.

Time complexity: O(1)

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

Bind an hash slot to a specific node.

Available since: 3.0.0.

Time complexity: O(1)
raw docstring

cluster-slavesclj

(cluster-slaves node-id)

CLUSTER SLAVES node-id

List slave nodes of the specified master node.

Available since: 3.0.0.

Time complexity: O(1)

CLUSTER SLAVES node-id

List slave nodes of the specified master node.

Available since: 3.0.0.

Time complexity: O(1)
raw docstring

cluster-slotsclj

(cluster-slots)

CLUSTER SLOTS

Get array of Cluster slot to node mappings.

Available since: 3.0.0.

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

CLUSTER SLOTS 

Get array of Cluster slot to node mappings.

Available since: 3.0.0.

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

commandclj

(command)

COMMAND

Get array of Redis command details.

Available since: 2.8.13.

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

COMMAND 

Get array of Redis command details.

Available since: 2.8.13.

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

command-countclj

(command-count)

COMMAND COUNT

Get total number of Redis commands.

Available since: 2.8.13.

Time complexity: O(1)

COMMAND COUNT 

Get total number of Redis commands.

Available since: 2.8.13.

Time complexity: O(1)
raw docstring

command-getkeysclj

(command-getkeys)

COMMAND GETKEYS

Extract keys given a full Redis command.

Available since: 2.8.13.

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

COMMAND GETKEYS 

Extract keys given a full Redis command.

Available since: 2.8.13.

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

command-infoclj

(command-info command-name & args)

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

Get array of specific Redis command details.

Available since: 2.8.13.

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

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

Get array of specific Redis command details.

Available since: 2.8.13.

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

compare-and-hsetclj

Experimental.

Experimental.
raw docstring

compare-and-setclj

Experimental.

Experimental.
raw docstring

config-getclj

(config-get parameter)

CONFIG GET parameter

Get the value of a configuration parameter.

Available since: 2.0.0.

Time complexity:

CONFIG GET parameter

Get the value of a configuration parameter.

Available since: 2.0.0.

Time complexity: 
raw docstring

config-resetstatclj

(config-resetstat)

CONFIG RESETSTAT

Reset the stats returned by INFO.

Available since: 2.0.0.

Time complexity: O(1)

CONFIG RESETSTAT 

Reset the stats returned by INFO.

Available since: 2.0.0.

Time complexity: O(1)
raw docstring

config-rewriteclj

(config-rewrite)

CONFIG REWRITE

Rewrite the configuration file with the in memory configuration.

Available since: 2.8.0.

Time complexity:

CONFIG REWRITE 

Rewrite the configuration file with the in memory configuration.

Available since: 2.8.0.

Time complexity: 
raw docstring

config-setclj

(config-set parameter value)

CONFIG SET parameter value

Set a configuration parameter to the given value.

Available since: 2.0.0.

Time complexity:

CONFIG SET parameter value

Set a configuration parameter to the given value.

Available since: 2.0.0.

Time complexity: 
raw docstring

dbsizeclj

(dbsize)

DBSIZE

Return the number of keys in the selected database.

Available since: 1.0.0.

Time complexity:

DBSIZE 

Return the number of keys in the selected database.

Available since: 1.0.0.

Time complexity: 
raw docstring

debug-objectclj

(debug-object key)

DEBUG OBJECT key

Get debugging information about a key.

Available since: 1.0.0.

Time complexity:

DEBUG OBJECT key

Get debugging information about a key.

Available since: 1.0.0.

Time complexity: 
raw docstring

debug-segfaultclj

(debug-segfault)

DEBUG SEGFAULT

Make the server crash.

Available since: 1.0.0.

Time complexity:

DEBUG SEGFAULT 

Make the server crash.

Available since: 1.0.0.

Time complexity: 
raw docstring

decrclj

(decr key)

DECR key

Decrement the integer value of a key by one.

Available since: 1.0.0.

Time complexity: O(1)

DECR key

Decrement the integer value of a key by one.

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

decrbyclj

(decrby key decrement)

DECRBY key decrement

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

Available since: 1.0.0.

Time complexity: O(1)

DECRBY key decrement

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

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

delclj

(del key & args)

DEL key [key ...]

Delete a 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).

DEL key [key ...]

Delete a 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).
raw docstring

discardclj

(discard)

DISCARD

Discard all commands issued after MULTI.

Available since: 2.0.0.

Time complexity:

DISCARD 

Discard all commands issued after MULTI.

Available since: 2.0.0.

Time complexity: 
raw docstring

dumpclj

(dump key)

DUMP key

Return a serialized version of the value stored at the specified 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).

DUMP key

Return a serialized version of the value stored at the specified 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).
raw docstring

echoclj

(echo message)

ECHO message

Echo the given string.

Available since: 1.0.0.

Time complexity:

ECHO message

Echo the given string.

Available since: 1.0.0.

Time complexity: 
raw docstring

ensure-atomicallycljmacro

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

DEPRECATED: Use atomic instead.

DEPRECATED: Use `atomic` instead.
raw docstring

evalclj

(eval script numkeys key & args)

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

Execute a Lua script server side.

Available since: 2.6.0.

Time complexity: Depends on the script that is executed.

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

Execute a Lua script server side.

Available since: 2.6.0.

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

eval*clj

(eval* script numkeys key & 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.
raw docstring

evalshaclj

(evalsha sha1 numkeys key & args)

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

Execute a Lua script server side.

Available since: 2.6.0.

Time complexity: Depends on the script that is executed.

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

Execute a Lua script server side.

Available since: 2.6.0.

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

evalsha*clj

(evalsha* script numkeys key & args)

Like evalsha but automatically computes SHA1 hash for script.

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

execclj

(exec)

EXEC

Execute all commands issued after MULTI.

Available since: 1.2.0.

Time complexity:

EXEC 

Execute all commands issued after MULTI.

Available since: 1.2.0.

Time complexity: 
raw docstring

existsclj

(exists key & args)

EXISTS key [key ...]

Determine if a key exists.

Available since: 1.0.0.

Time complexity: O(1)

EXISTS key [key ...]

Determine if a key exists.

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

expireclj

(expire key seconds)

EXPIRE key seconds

Set a key's time to live in seconds.

Available since: 1.0.0.

Time complexity: O(1)

EXPIRE key seconds

Set a key's time to live in seconds.

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

expireatclj

(expireat key timestamp)

EXPIREAT key timestamp

Set the expiration for a key as a UNIX timestamp.

Available since: 1.2.0.

Time complexity: O(1)

EXPIREAT key timestamp

Set the expiration for a key as a UNIX timestamp.

Available since: 1.2.0.

Time complexity: O(1)
raw docstring

flushallclj

(flushall)

FLUSHALL

Remove all keys from all databases.

Available since: 1.0.0.

Time complexity:

FLUSHALL 

Remove all keys from all databases.

Available since: 1.0.0.

Time complexity: 
raw docstring

flushdbclj

(flushdb)

FLUSHDB

Remove all keys from the current database.

Available since: 1.0.0.

Time complexity:

FLUSHDB 

Remove all keys from the current database.

Available since: 1.0.0.

Time complexity: 
raw docstring

freezeclj

(freeze value & [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.
raw docstring

geoaddclj

(geoadd key longitude latitude member & args)

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

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

Available since: .

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

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

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

Available since: .

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

geodistclj

(geodist key member1 member2 & args)

GEODIST key member1 member2 [unit]

Returns the distance between two members of a geospatial index.

Available since: .

Time complexity: O(log(N))

GEODIST key member1 member2 [unit]

Returns the distance between two members of a geospatial index.

Available since: .

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

geohashclj

(geohash key member & args)

GEOHASH key member [member ...]

Returns members of a geospatial index as standard geohash strings.

Available since: .

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

GEOHASH key member [member ...]

Returns members of a geospatial index as standard geohash strings.

Available since: .

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

geoposclj

(geopos key member & args)

GEOPOS key member [member ...]

Returns longitude and latitude of members of a geospatial index.

Available since: .

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

GEOPOS key member [member ...]

Returns longitude and latitude of members of a geospatial index.

Available since: .

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

georadiusclj

(georadius key longitude latitude radius unit & args)

GEORADIUS key longitude latitude radius m|km|ft|mi [WITHCOORD] [WITHDIST] [WITHHASH] [count]

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

Available since: .

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.

GEORADIUS key longitude latitude radius m|km|ft|mi [WITHCOORD] [WITHDIST] [WITHHASH] [count]

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

Available since: .

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.
raw docstring

georadiusbymemberclj

(georadiusbymember key member radius unit & args)

GEORADIUSBYMEMBER key member radius m|km|ft|mi [WITHCOORD] [WITHDIST] [WITHHASH] [count]

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

Available since: .

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.

GEORADIUSBYMEMBER key member radius m|km|ft|mi [WITHCOORD] [WITHDIST] [WITHHASH] [count]

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

Available since: .

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.
raw docstring

getclj

(get key)

GET key

Get the value of a key.

Available since: 1.0.0.

Time complexity: O(1)

GET key

Get the value of a key.

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

getbitclj

(getbit key offset)

GETBIT key offset

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

Available since: 2.2.0.

Time complexity: O(1)

GETBIT key offset

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

Available since: 2.2.0.

Time complexity: O(1)
raw docstring

getrangeclj

(getrange key start end)

GETRANGE key start end

Get a substring of the string stored at a key.

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.

GETRANGE key start end

Get a substring of the string stored at a key.

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.
raw docstring

getsetclj

(getset key value)

GETSET key value

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

Available since: 1.0.0.

Time complexity: O(1)

GETSET key value

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

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

hash-scriptclj

DEPRECATED: Use script-hash instead.

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

hdelclj

(hdel key field & args)

HDEL key field [field ...]

Delete one or more hash fields.

Available since: 2.0.0.

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

HDEL key field [field ...]

Delete one or more hash fields.

Available since: 2.0.0.

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

hexistsclj

(hexists key field)

HEXISTS key field

Determine if a hash field exists.

Available since: 2.0.0.

Time complexity: O(1)

HEXISTS key field

Determine if a hash field exists.

Available since: 2.0.0.

Time complexity: O(1)
raw docstring

hgetclj

(hget key field)

HGET key field

Get the value of a hash field.

Available since: 2.0.0.

Time complexity: O(1)

HGET key field

Get the value of a hash field.

Available since: 2.0.0.

Time complexity: O(1)
raw docstring

hgetallclj

(hgetall key)

HGETALL key

Get all the fields and values in a hash.

Available since: 2.0.0.

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

HGETALL key

Get all the fields and values in a hash.

Available since: 2.0.0.

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

hgetall*clj

(hgetall* key & [keywordize?])

DEPRECATED: Use parse-map instead.

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

hincrbyclj

(hincrby key field increment)

HINCRBY key field increment

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

Available since: 2.0.0.

Time complexity: O(1)

HINCRBY key field increment

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

Available since: 2.0.0.

Time complexity: O(1)
raw docstring

hincrbyfloatclj

(hincrbyfloat key field increment)

HINCRBYFLOAT key field increment

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

Available since: 2.6.0.

Time complexity: O(1)

HINCRBYFLOAT key field increment

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

Available since: 2.6.0.

Time complexity: O(1)
raw docstring

hkeysclj

(hkeys key)

HKEYS key

Get all the fields in a hash.

Available since: 2.0.0.

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

HKEYS key

Get all the fields in a hash.

Available since: 2.0.0.

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

hlenclj

(hlen key)

HLEN key

Get the number of fields in a hash.

Available since: 2.0.0.

Time complexity: O(1)

HLEN key

Get the number of fields in a hash.

Available since: 2.0.0.

Time complexity: O(1)
raw docstring

hmgetclj

(hmget key field & args)

HMGET key field [field ...]

Get the values of all the given hash fields.

Available since: 2.0.0.

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

HMGET key field [field ...]

Get the values of all the given hash fields.

Available since: 2.0.0.

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

hmget*clj

(hmget* key field & more)

DEPRECATED: Use parse-map instead.

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

hmsetclj

(hmset key field value & args)

HMSET key ["field" "value"] [["field" "value"] ...]

Set multiple hash fields to multiple values.

Available since: 2.0.0.

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

HMSET key ["field" "value"] [["field" "value"] ...]

Set multiple hash fields to multiple values.

Available since: 2.0.0.

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

hmset*clj

(hmset* key m)

Like hmset but takes a map argument.

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

hscanclj

(hscan key cursor & args)

HSCAN key cursor [MATCH pattern] [COUNT count]

Incrementally iterate hash fields and associated values.

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..

HSCAN key cursor [MATCH pattern] [COUNT count]

Incrementally iterate hash fields and associated values.

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..
raw docstring

hsetclj

(hset key field value)

HSET key field value

Set the string value of a hash field.

Available since: 2.0.0.

Time complexity: O(1)

HSET key field value

Set the string value of a hash field.

Available since: 2.0.0.

Time complexity: O(1)
raw docstring

hsetnxclj

(hsetnx key field value)

HSETNX key field value

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

Available since: 2.0.0.

Time complexity: O(1)

HSETNX key field value

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

Available since: 2.0.0.

Time complexity: O(1)
raw docstring

hstrlenclj

(hstrlen key field)

HSTRLEN key field

Get the length of the value of a hash field.

Available since: 3.2.0.

Time complexity: O(1)

HSTRLEN key field

Get the length of the value of a hash field.

Available since: 3.2.0.

Time complexity: O(1)
raw docstring

hswapclj

Experimental.

Experimental.
raw docstring

hvalsclj

(hvals key)

HVALS key

Get all the values in a hash.

Available since: 2.0.0.

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

HVALS key

Get all the values in a hash.

Available since: 2.0.0.

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

incrclj

(incr key)

INCR key

Increment the integer value of a key by one.

Available since: 1.0.0.

Time complexity: O(1)

INCR key

Increment the integer value of a key by one.

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

incrbyclj

(incrby key increment)

INCRBY key increment

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

Available since: 1.0.0.

Time complexity: O(1)

INCRBY key increment

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

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

incrbyfloatclj

(incrbyfloat key increment)

INCRBYFLOAT key increment

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

Available since: 2.6.0.

Time complexity: O(1)

INCRBYFLOAT key increment

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

Available since: 2.6.0.

Time complexity: O(1)
raw docstring

infoclj

(info & args)

INFO [section]

Get information and statistics about the server.

Available since: 1.0.0.

Time complexity:

INFO [section]

Get information and statistics about the server.

Available since: 1.0.0.

Time complexity: 
raw 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.
raw 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.).
raw docstring

keysclj

(keys pattern)

KEYS pattern

Find all keys matching the given 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.

KEYS pattern

Find all keys matching the given 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.
raw docstring

knameclj

(kname & parts)

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

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

lastsaveclj

(lastsave)

LASTSAVE

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

Available since: 1.0.0.

Time complexity:

LASTSAVE 

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

Available since: 1.0.0.

Time complexity: 
raw docstring

lindexclj

(lindex key index)

LINDEX key index

Get an element from a list by its 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).

LINDEX key index

Get an element from a list by its 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).
raw docstring

linsertclj

(linsert key where pivot value)

LINSERT key BEFORE|AFTER pivot value

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

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).

LINSERT key BEFORE|AFTER pivot value

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

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).
raw docstring

llenclj

(llen key)

LLEN key

Get the length of a list.

Available since: 1.0.0.

Time complexity: O(1)

LLEN key

Get the length of a list.

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

lpopclj

(lpop key)

LPOP key

Remove and get the first element in a list.

Available since: 1.0.0.

Time complexity: O(1)

LPOP key

Remove and get the first element in a list.

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

lpushclj

(lpush key value & args)

LPUSH key value [value ...]

Prepend one or multiple values to a list.

Available since: 1.0.0.

Time complexity: O(1)

LPUSH key value [value ...]

Prepend one or multiple values to a list.

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

lpushxclj

(lpushx key value)

LPUSHX key value

Prepend a value to a list, only if the list exists.

Available since: 2.2.0.

Time complexity: O(1)

LPUSHX key value

Prepend a value to a list, only if the list exists.

Available since: 2.2.0.

Time complexity: O(1)
raw docstring

lrangeclj

(lrange key start stop)

LRANGE key start stop

Get a range of elements from a list.

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.

LRANGE key start stop

Get a range of elements from a list.

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.
raw docstring

lremclj

(lrem key count value)

LREM key count value

Remove elements from a list.

Available since: 1.0.0.

Time complexity: O(N) where N is the length of the list.

LREM key count value

Remove elements from a list.

Available since: 1.0.0.

Time complexity: O(N) where N is the length of the list.
raw docstring

lsetclj

(lset key index value)

LSET key index value

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

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).

LSET key index value

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

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).
raw docstring

ltrimclj

(ltrim key start stop)

LTRIM key start stop

Trim a list to the specified range.

Available since: 1.0.0.

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

LTRIM key start stop

Trim a list to the specified range.

Available since: 1.0.0.

Time complexity: O(N) where N is the number of elements to be removed by the operation.
raw 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).
raw 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).
raw docstring

lua-scriptclj

(lua-script & args)

DEPRECATED: Use lua instead.

DEPRECATED: Use `lua` instead.
raw docstring

make-conn-poolclj

(make-conn-pool & opts)

DEPRECATED: Use wcar instead.

DEPRECATED: Use `wcar` instead.
raw docstring

make-conn-specclj

(make-conn-spec & opts)

DEPRECATED: Use wcar instead.

DEPRECATED: Use `wcar` instead.
raw docstring

make-keyfnclj

(make-keyfn & prefix-parts)

DEPRECATED: Use kname instead.

DEPRECATED: Use `kname` instead.
raw docstring

mgetclj

(mget key & args)

MGET key [key ...]

Get the values of all the given keys.

Available since: 1.0.0.

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

MGET key [key ...]

Get the values of all the given keys.

Available since: 1.0.0.

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

migrateclj

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

MIGRATE host port key destination-db timeout [COPY] [REPLACE]

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

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.

MIGRATE host port key destination-db timeout [COPY] [REPLACE]

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

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.
raw docstring

monitorclj

(monitor)

MONITOR

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

Available since: 1.0.0.

Time complexity:

MONITOR 

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

Available since: 1.0.0.

Time complexity: 
raw docstring

moveclj

(move key db)

MOVE key db

Move a key to another database.

Available since: 1.0.0.

Time complexity: O(1)

MOVE key db

Move a key to another database.

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

msetclj

(mset key value & args)

MSET ["key" "value"] [["key" "value"] ...]

Set multiple keys to multiple values.

Available since: 1.0.1.

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

MSET ["key" "value"] [["key" "value"] ...]

Set multiple keys to multiple values.

Available since: 1.0.1.

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

msetnxclj

(msetnx key value & args)

MSETNX ["key" "value"] [["key" "value"] ...]

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

Available since: 1.0.1.

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

MSETNX ["key" "value"] [["key" "value"] ...]

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

Available since: 1.0.1.

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

multiclj

(multi)

MULTI

Mark the start of a transaction block.

Available since: 1.2.0.

Time complexity:

MULTI 

Mark the start of a transaction block.

Available since: 1.2.0.

Time complexity: 
raw docstring

objectclj

(object subcommand & args)

OBJECT subcommand [arguments [arguments ...]]

Inspect the internals of Redis objects.

Available since: 2.2.3.

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

OBJECT subcommand [arguments [arguments ...]]

Inspect the internals of Redis objects.

Available since: 2.2.3.

Time complexity: O(1) for all the currently implemented subcommands.
raw 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`.
raw docstring

parse-boolcljmacro

(parse-bool & body)

parse-doublecljmacro

(parse-double & body)

DEPRECATED: Use parse-float instead.

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

parse-floatcljmacro

(parse-float & body)

parse-intcljmacro

(parse-int & body)

parse-keywordcljmacro

(parse-keyword & body)

parse-longcljmacro

(parse-long & body)

DEPRECATED: Use parse-int instead.

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

parse-mapcljmacro

(parse-map form & [kf vf])

parse-nippycljmacro

(parse-nippy thaw-opts & body)

parse-rawcljmacro

(parse-raw & body)

parse-suppresscljmacro

(parse-suppress & body)

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.
raw docstring

persistclj

(persist key)

PERSIST key

Remove the expiration from a key.

Available since: 2.2.0.

Time complexity: O(1)

PERSIST key

Remove the expiration from a key.

Available since: 2.2.0.

Time complexity: O(1)
raw docstring

pexpireclj

(pexpire key milliseconds)

PEXPIRE key milliseconds

Set a key's time to live in milliseconds.

Available since: 2.6.0.

Time complexity: O(1)

PEXPIRE key milliseconds

Set a key's time to live in milliseconds.

Available since: 2.6.0.

Time complexity: O(1)
raw docstring

pexpireatclj

(pexpireat key milliseconds-timestamp)

PEXPIREAT key milliseconds-timestamp

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

Available since: 2.6.0.

Time complexity: O(1)

PEXPIREAT key milliseconds-timestamp

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

Available since: 2.6.0.

Time complexity: O(1)
raw docstring

pfaddclj

(pfadd key element & args)

PFADD key element [element ...]

Adds the specified elements to the specified HyperLogLog..

Available since: 2.8.9.

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

PFADD key element [element ...]

Adds the specified elements to the specified HyperLogLog..

Available since: 2.8.9.

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

pfcountclj

(pfcount key & args)

PFCOUNT key [key ...]

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

Available since: 2.8.9.

Time complexity: O(1) with every small average constant times 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.

PFCOUNT key [key ...]

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

Available since: 2.8.9.

Time complexity: O(1) with every small average constant times 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.
raw docstring

pfmergeclj

(pfmerge destkey sourcekey & args)

PFMERGE destkey sourcekey [sourcekey ...]

Merge N different HyperLogLogs into a single one..

Available since: 2.8.9.

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

PFMERGE destkey sourcekey [sourcekey ...]

Merge N different HyperLogLogs into a single one..

Available since: 2.8.9.

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

pingclj

(ping)

PING

Ping the server.

Available since: 1.0.0.

Time complexity:

PING 

Ping the server.

Available since: 1.0.0.

Time complexity: 
raw docstring

preserveclj

DEPRECATED: Use freeze instead.

DEPRECATED: Use `freeze` instead.
raw docstring

psetexclj

(psetex key milliseconds value)

PSETEX key milliseconds value

Set the value and expiration in milliseconds of a key.

Available since: 2.6.0.

Time complexity: O(1)

PSETEX key milliseconds value

Set the value and expiration in milliseconds of a key.

Available since: 2.6.0.

Time complexity: O(1)
raw docstring

psubscribeclj

(psubscribe pattern & args)

PSUBSCRIBE pattern [pattern ...]

Listen for messages published to channels matching the given patterns.

Available since: 2.0.0.

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

PSUBSCRIBE pattern [pattern ...]

Listen for messages published to channels matching the given patterns.

Available since: 2.0.0.

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

pttlclj

(pttl key)

PTTL key

Get the time to live for a key in milliseconds.

Available since: 2.6.0.

Time complexity: O(1)

PTTL key

Get the time to live for a key in milliseconds.

Available since: 2.6.0.

Time complexity: O(1)
raw docstring

publishclj

(publish channel message)

PUBLISH channel message

Post a message to a channel.

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).

PUBLISH channel message

Post a message to a channel.

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).
raw docstring

pubsubclj

(pubsub subcommand & args)

PUBSUB subcommand [argument [argument ...]]

Inspect the state of the Pub/Sub subsystem.

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.

PUBSUB subcommand [argument [argument ...]]

Inspect the state of the Pub/Sub subsystem.

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.
raw docstring

punsubscribeclj

(punsubscribe & args)

PUNSUBSCRIBE [pattern [pattern ...]]

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

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).

PUNSUBSCRIBE [pattern [pattern ...]]

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

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).
raw docstring

quitclj

(quit)

QUIT

Close the connection.

Available since: 1.0.0.

Time complexity:

QUIT 

Close the connection.

Available since: 1.0.0.

Time complexity: 
raw docstring

randomkeyclj

(randomkey)

RANDOMKEY

Return a random key from the keyspace.

Available since: 1.0.0.

Time complexity: O(1)

RANDOMKEY 

Return a random key from the keyspace.

Available since: 1.0.0.

Time complexity: O(1)
raw 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.
raw 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"])
raw docstring

rememberclj

DEPRECATED: Use return instead.

DEPRECATED: Use `return` instead.
raw docstring

renameclj

(rename key newkey)

RENAME key newkey

Rename a key.

Available since: 1.0.0.

Time complexity: O(1)

RENAME key newkey

Rename a key.

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

renamenxclj

(renamenx key newkey)

RENAMENX key newkey

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

Available since: 1.0.0.

Time complexity: O(1)

RENAMENX key newkey

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

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

restoreclj

(restore key ttl serialized-value & args)

RESTORE key ttl serialized-value [REPLACE]

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

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)).

RESTORE key ttl serialized-value [REPLACE]

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

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)).
raw 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.
raw docstring

roleclj

(role)

ROLE

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

Available since: 2.8.12.

Time complexity:

ROLE 

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

Available since: 2.8.12.

Time complexity: 
raw docstring

rpopclj

(rpop key)

RPOP key

Remove and get the last element in a list.

Available since: 1.0.0.

Time complexity: O(1)

RPOP key

Remove and get the last element in a list.

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

rpoplpushclj

(rpoplpush source destination)

RPOPLPUSH source destination

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

Available since: 1.2.0.

Time complexity: O(1)

RPOPLPUSH source destination

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

Available since: 1.2.0.

Time complexity: O(1)
raw docstring

rpushclj

(rpush key value & args)

RPUSH key value [value ...]

Append one or multiple values to a list.

Available since: 1.0.0.

Time complexity: O(1)

RPUSH key value [value ...]

Append one or multiple values to a list.

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

rpushxclj

(rpushx key value)

RPUSHX key value

Append a value to a list, only if the list exists.

Available since: 2.2.0.

Time complexity: O(1)

RPUSHX key value

Append a value to a list, only if the list exists.

Available since: 2.2.0.

Time complexity: O(1)
raw docstring

saddclj

(sadd key member & args)

SADD key member [member ...]

Add one or more members to a set.

Available since: 1.0.0.

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

SADD key member [member ...]

Add one or more members to a set.

Available since: 1.0.0.

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

saveclj

(save)

SAVE

Synchronously save the dataset to disk.

Available since: 1.0.0.

Time complexity:

SAVE 

Synchronously save the dataset to disk.

Available since: 1.0.0.

Time complexity: 
raw docstring

scanclj

(scan cursor & args)

SCAN cursor [MATCH pattern] [COUNT count]

Incrementally iterate the keys space.

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..

SCAN cursor [MATCH pattern] [COUNT count]

Incrementally iterate the keys space.

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..
raw docstring

scardclj

(scard key)

SCARD key

Get the number of members in a set.

Available since: 1.0.0.

Time complexity: O(1)

SCARD key

Get the number of members in a set.

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

script-existsclj

(script-exists script & args)

SCRIPT EXISTS script [script ...]

Check existence of scripts in the script cache..

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).

SCRIPT EXISTS script [script ...]

Check existence of scripts in the script cache..

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).
raw docstring

script-flushclj

(script-flush)

SCRIPT FLUSH

Remove all the scripts from the script cache..

Available since: 2.6.0.

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

SCRIPT FLUSH 

Remove all the scripts from the script cache..

Available since: 2.6.0.

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

script-hashclj


script-killclj

(script-kill)

SCRIPT KILL

Kill the script currently in execution..

Available since: 2.6.0.

Time complexity: O(1)

SCRIPT KILL 

Kill the script currently in execution..

Available since: 2.6.0.

Time complexity: O(1)
raw docstring

script-loadclj

(script-load script)

SCRIPT LOAD script

Load the specified Lua script into the script cache..

Available since: 2.6.0.

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

SCRIPT LOAD script

Load the specified Lua script into the script cache..

Available since: 2.6.0.

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

sdiffclj

(sdiff key & args)

SDIFF key [key ...]

Subtract multiple sets.

Available since: 1.0.0.

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

SDIFF key [key ...]

Subtract multiple sets.

Available since: 1.0.0.

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

sdiffstoreclj

(sdiffstore destination key & args)

SDIFFSTORE destination key [key ...]

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

Available since: 1.0.0.

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

SDIFFSTORE destination key [key ...]

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

Available since: 1.0.0.

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

selectclj

(select index)

SELECT index

Change the selected database for the current connection.

Available since: 1.0.0.

Time complexity:

SELECT index

Change the selected database for the current connection.

Available since: 1.0.0.

Time complexity: 
raw docstring

serializeclj

DEPRECATED: Use freeze instead.

DEPRECATED: Use `freeze` instead.
raw docstring

setclj

(set key value & args)

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

Set the string value of a key.

Available since: 1.0.0.

Time complexity: O(1)

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

Set the string value of a key.

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

setbitclj

(setbit key offset value)

SETBIT key offset value

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

Available since: 2.2.0.

Time complexity: O(1)

SETBIT key offset value

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

Available since: 2.2.0.

Time complexity: O(1)
raw docstring

setexclj

(setex key seconds value)

SETEX key seconds value

Set the value and expiration of a key.

Available since: 2.0.0.

Time complexity: O(1)

SETEX key seconds value

Set the value and expiration of a key.

Available since: 2.0.0.

Time complexity: O(1)
raw docstring

setnxclj

(setnx key value)

SETNX key value

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

Available since: 1.0.0.

Time complexity: O(1)

SETNX key value

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

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

setrangeclj

(setrange key offset value)

SETRANGE key offset value

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

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.

SETRANGE key offset value

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

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.
raw docstring

shutdownclj

(shutdown & args)

SHUTDOWN [NOSAVE] [SAVE]

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

Available since: 1.0.0.

Time complexity:

SHUTDOWN [NOSAVE] [SAVE]

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

Available since: 1.0.0.

Time complexity: 
raw docstring

sinterclj

(sinter key & args)

SINTER key [key ...]

Intersect multiple sets.

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.

SINTER key [key ...]

Intersect multiple sets.

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.
raw docstring

sinterstoreclj

(sinterstore destination key & args)

SINTERSTORE destination key [key ...]

Intersect multiple sets and store the resulting set in a 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.

SINTERSTORE destination key [key ...]

Intersect multiple sets and store the resulting set in a 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.
raw docstring

sismemberclj

(sismember key member)

SISMEMBER key member

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

Available since: 1.0.0.

Time complexity: O(1)

SISMEMBER key member

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

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

skip-repliescljmacro

DEPRECATED: Use with-replies instead.

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

slaveofclj

(slaveof host port)

SLAVEOF host port

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

Available since: 1.0.0.

Time complexity:

SLAVEOF host port

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

Available since: 1.0.0.

Time complexity: 
raw docstring

slowlogclj

(slowlog subcommand & args)

SLOWLOG subcommand [argument]

Manages the Redis slow queries log.

Available since: 2.2.12.

Time complexity:

SLOWLOG subcommand [argument]

Manages the Redis slow queries log.

Available since: 2.2.12.

Time complexity: 
raw docstring

smembersclj

(smembers key)

SMEMBERS key

Get all the members in a set.

Available since: 1.0.0.

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

SMEMBERS key

Get all the members in a set.

Available since: 1.0.0.

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

smoveclj

(smove source destination member)

SMOVE source destination member

Move a member from one set to another.

Available since: 1.0.0.

Time complexity: O(1)

SMOVE source destination member

Move a member from one set to another.

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

sortclj

(sort key & args)

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

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

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 key [BY pattern] [LIMIT offset count] [GET pattern [GET pattern ...]] [ASC|DESC] [ALPHA] [STORE destination]

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

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.
raw 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.
raw docstring

spopclj

(spop key & args)

SPOP key [count]

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

Available since: 1.0.0.

Time complexity: O(1)

SPOP key [count]

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

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

srandmemberclj

(srandmember key & args)

SRANDMEMBER key [count]

Get one or multiple random members from a set.

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.

SRANDMEMBER key [count]

Get one or multiple random members from a set.

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.
raw docstring

sremclj

(srem key member & args)

SREM key member [member ...]

Remove one or more members from a set.

Available since: 1.0.0.

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

SREM key member [member ...]

Remove one or more members from a set.

Available since: 1.0.0.

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

sscanclj

(sscan key cursor & args)

SSCAN key cursor [MATCH pattern] [COUNT count]

Incrementally iterate Set elements.

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..

SSCAN key cursor [MATCH pattern] [COUNT count]

Incrementally iterate Set elements.

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..
raw docstring

strlenclj

(strlen key)

STRLEN key

Get the length of the value stored in a key.

Available since: 2.2.0.

Time complexity: O(1)

STRLEN key

Get the length of the value stored in a key.

Available since: 2.2.0.

Time complexity: O(1)
raw docstring

subscribeclj

(subscribe channel & args)

SUBSCRIBE channel [channel ...]

Listen for messages published to the given channels.

Available since: 2.0.0.

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

SUBSCRIBE channel [channel ...]

Listen for messages published to the given channels.

Available since: 2.0.0.

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

sunionclj

(sunion key & args)

SUNION key [key ...]

Add multiple sets.

Available since: 1.0.0.

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

SUNION key [key ...]

Add multiple sets.

Available since: 1.0.0.

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

sunionstoreclj

(sunionstore destination key & args)

SUNIONSTORE destination key [key ...]

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

Available since: 1.0.0.

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

SUNIONSTORE destination key [key ...]

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

Available since: 1.0.0.

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

swapclj

Experimental.

Experimental.
raw docstring

syncclj

(sync)

SYNC

Internal command used for replication.

Available since: 1.0.0.

Time complexity:

SYNC 

Internal command used for replication.

Available since: 1.0.0.

Time complexity: 
raw docstring

timeclj

(time)

TIME

Return the current server time.

Available since: 2.6.0.

Time complexity: O(1)

TIME 

Return the current server time.

Available since: 2.6.0.

Time complexity: O(1)
raw docstring

ttlclj

(ttl key)

TTL key

Get the time to live for a key.

Available since: 1.0.0.

Time complexity: O(1)

TTL key

Get the time to live for a key.

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

typeclj

(type key)

TYPE key

Determine the type stored at key.

Available since: 1.0.0.

Time complexity: O(1)

TYPE key

Determine the type stored at key.

Available since: 1.0.0.

Time complexity: O(1)
raw docstring

unsubscribeclj

(unsubscribe & args)

UNSUBSCRIBE [channel [channel ...]]

Stop listening for messages posted to the given channels.

Available since: 2.0.0.

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

UNSUBSCRIBE [channel [channel ...]]

Stop listening for messages posted to the given channels.

Available since: 2.0.0.

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

unwatchclj

(unwatch)

UNWATCH

Forget about all watched keys.

Available since: 2.2.0.

Time complexity: O(1)

UNWATCH 

Forget about all watched keys.

Available since: 2.2.0.

Time complexity: O(1)
raw docstring

waitclj

(wait numslaves timeout)

WAIT numslaves timeout

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

Available since: 3.0.0.

Time complexity: O(1)

WAIT numslaves timeout

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

Available since: 3.0.0.

Time complexity: O(1)
raw docstring

watchclj

(watch key & args)

WATCH key [key ...]

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

Available since: 2.2.0.

Time complexity: O(1) for every key.

WATCH key [key ...]

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

Available since: 2.2.0.

Time complexity: O(1) for every key.
raw 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: {:pool {} :spec {:host "127.0.0.1" :port 6379}} ; Default {:pool {} :spec {:uri "redis://redistogo:pass@panga.redistogo.com:9475/"}} {:pool {} :spec {:host "127.0.0.1" :port 6379 :password "secret" :timeout-ms 6000 :db 3}}

A nil or {} conn-opts will use defaults. A :none pool can be used to skip connection pooling (not recommended). For other pool options, Ref. http://goo.gl/e1p1h3, http://goo.gl/Sz4uN1 (defaults).

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.

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:
  {:pool {} :spec {:host "127.0.0.1" :port 6379}} ; Default
  {:pool {} :spec {:uri "redis://redistogo:pass@panga.redistogo.com:9475/"}}
  {:pool {} :spec {:host "127.0.0.1" :port 6379
                   :password "secret"
                   :timeout-ms 6000
                   :db 3}}

A `nil` or `{}` `conn-opts` will use defaults. A `:none` pool can be used
to skip connection pooling (not recommended).
For other pool options, Ref. http://goo.gl/e1p1h3,
                             http://goo.gl/Sz4uN1 (defaults).

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`.
raw docstring

with-conncljmacro

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

DEPRECATED: Use wcar instead.

DEPRECATED: Use `wcar` instead.
raw 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.
raw 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.
raw 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.
raw docstring

with-parsercljmacro

DEPRECATED: Use parse instead.

DEPRECATED: Use `parse` instead.
raw 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.
raw docstring

with-replycljmacro

DEPRECATED: Use with-replies instead.

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

with-thaw-optscljmacro

(with-thaw-opts opts & body)

Evaluates body using given options for any automatic deserialization in context.

Evaluates body using given options for any automatic deserialization in
context.
raw docstring

zaddclj

(zadd key & args)

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

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

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.

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

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

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.
raw docstring

zcardclj

(zcard key)

ZCARD key

Get the number of members in a sorted set.

Available since: 1.2.0.

Time complexity: O(1)

ZCARD key

Get the number of members in a sorted set.

Available since: 1.2.0.

Time complexity: O(1)
raw docstring

zcountclj

(zcount key min max)

ZCOUNT key min max

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

Available since: 2.0.0.

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

ZCOUNT key min max

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

Available since: 2.0.0.

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

zincrbyclj

(zincrby key increment member)

ZINCRBY key increment member

Increment the score of a member in a sorted set.

Available since: 1.2.0.

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

ZINCRBY key increment member

Increment the score of a member in a sorted set.

Available since: 1.2.0.

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

zinterstoreclj

(zinterstore destination numkeys key & args)

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

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

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.

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

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

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.
raw docstring

zinterstore*clj

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

Like zinterstore but automatically counts keys.

Like `zinterstore` but automatically counts keys.
raw docstring

zlexcountclj

(zlexcount key min max)

ZLEXCOUNT key min max

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

Available since: 2.8.9.

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

ZLEXCOUNT key min max

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

Available since: 2.8.9.

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

zrangeclj

(zrange key start stop & args)

ZRANGE key start stop [WITHSCORES]

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

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.

ZRANGE key start stop [WITHSCORES]

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

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.
raw docstring

zrangebylexclj

(zrangebylex key min max & args)

ZRANGEBYLEX key min max [LIMIT offset count]

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

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)).

ZRANGEBYLEX key min max [LIMIT offset count]

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

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)).
raw docstring

zrangebyscoreclj

(zrangebyscore key min max & args)

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

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

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)).

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

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

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)).
raw docstring

zrankclj

(zrank key member)

ZRANK key member

Determine the index of a member in a sorted set.

Available since: 2.0.0.

Time complexity: O(log(N))

ZRANK key member

Determine the index of a member in a sorted set.

Available since: 2.0.0.

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

zremclj

(zrem key member & args)

ZREM key member [member ...]

Remove one or more members from a sorted set.

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.

ZREM key member [member ...]

Remove one or more members from a sorted set.

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.
raw docstring

zremrangebylexclj

(zremrangebylex key min max)

ZREMRANGEBYLEX key min max

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

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.

ZREMRANGEBYLEX key min max

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

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.
raw docstring

zremrangebyrankclj

(zremrangebyrank key start stop)

ZREMRANGEBYRANK key start stop

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

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.

ZREMRANGEBYRANK key start stop

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

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.
raw docstring

zremrangebyscoreclj

(zremrangebyscore key min max)

ZREMRANGEBYSCORE key min max

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

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.

ZREMRANGEBYSCORE key min max

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

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.
raw docstring

zrevrangeclj

(zrevrange key start stop & args)

ZREVRANGE key start stop [WITHSCORES]

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

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.

ZREVRANGE key start stop [WITHSCORES]

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

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.
raw docstring

zrevrangebylexclj

(zrevrangebylex key max min & args)

ZREVRANGEBYLEX key max min [LIMIT offset count]

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

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)).

ZREVRANGEBYLEX key max min [LIMIT offset count]

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

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)).
raw docstring

zrevrangebyscoreclj

(zrevrangebyscore key max min & args)

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

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

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)).

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

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

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)).
raw docstring

zrevrankclj

(zrevrank key member)

ZREVRANK key member

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

Available since: 2.0.0.

Time complexity: O(log(N))

ZREVRANK key member

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

Available since: 2.0.0.

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

zscanclj

(zscan key cursor & args)

ZSCAN key cursor [MATCH pattern] [COUNT count]

Incrementally iterate sorted sets elements and associated scores.

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..

ZSCAN key cursor [MATCH pattern] [COUNT count]

Incrementally iterate sorted sets elements and associated scores.

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..
raw docstring

zscoreclj

(zscore key member)

ZSCORE key member

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

Available since: 1.2.0.

Time complexity: O(1)

ZSCORE key member

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

Available since: 1.2.0.

Time complexity: O(1)
raw docstring

zunionstoreclj

(zunionstore destination numkeys key & args)

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

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

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.

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

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

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.
raw docstring

zunionstore*clj

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

Like zunionstore but automatically counts keys.

Like `zunionstore` but automatically counts keys.
raw docstring

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

× close