(append key value)
(auth password)
(bgsave)
(bgwriteaof)
(blpop key timeout)
(brpop key timeout)
(brpoplpush source destination timeout)
(connection-map)
(connection-map spec)
Creates the initial connection spec. Options can be overridden by passing in a map. The following keys are valid:
:host :port :password :socket :timeout
Although passing in your own socket is not recommended and will probably cause more problems than it solves
Creates the initial connection spec. Options can be overridden by passing in a map. The following keys are valid: :host :port :password :socket :timeout Although passing in your own socket is not recommended and will probably cause more problems than it solves
(dbsize)
(decr key)
(decrby key increment)
(defqueries & queries)
Given any number of redis commands and argument lists, convert them to function definitions.
This is an interesting use of unquote splicing. Unquote splicing works on a sequence and that sequence can be the result of a function call as it is here. The function which produces this sequence maps each argument passed to this macro over a function which takes each list like (set [key value]), binds it to q, and uses unquote splicing again to create a call to defquery which looks like (defquery set [key value]).
Finally, a macro can only return a single form, so we wrap all of the produced expressions in a do special form.
Given any number of redis commands and argument lists, convert them to function definitions. This is an interesting use of unquote splicing. Unquote splicing works on a sequence and that sequence can be the result of a function call as it is here. The function which produces this sequence maps each argument passed to this macro over a function which takes each list like (set [key value]), binds it to q, and uses unquote splicing again to create a call to defquery which looks like (defquery set [key value]). Finally, a macro can only return a single form, so we wrap all of the produced expressions in a do special form.
(defquery name params)
Given a redis command and a parameter list, create a function of the form:
(defn <name> <parameter-list>
(query <command> <p1> <p2> ... <pN>))
The name which is passed is a symbol and is first used as a symbol for the function name. We convert this symbol to a string and use that string as the command name.
params is a list of N symbols which represent the parameters to the function. We use this list as the parameter-list when we create the function. Each symbol in this list will be an argument to query after the command. We use unquote splicing (~@) to insert these arguments after the command string.
Given a redis command and a parameter list, create a function of the form: (defn <name> <parameter-list> (query <command> <p1> <p2> ... <pN>)) The name which is passed is a symbol and is first used as a symbol for the function name. We convert this symbol to a string and use that string as the command name. params is a list of N symbols which represent the parameters to the function. We use this list as the parameter-list when we create the function. Each symbol in this list will be an argument to query after the command. We use unquote splicing (~@) to insert these arguments after the command string.
(del key & keys)
(discard)
(echo message)
(exec)
(exists key)
(expire key seconds)
(expireat key seconds)
(flushall)
(flushdb)
(get key)
(getbit key offset)
(getrange key start end)
(getset key value)
(hdel key field & fields)
(hexists key field)
(hget key field)
(hgetall key)
(hincrby key field increment)
(hkeys key)
(hlen key)
(hmget key field & fields)
(hmset key field value & pairs)
(hset key field value)
(hsetnx key field value)
(hvals key)
(incr key)
(incrby key increment)
(info)
(close this)
(subscribe this channels)
(unsubscribe this channels)
(keys pattern)
(lastsave)
(lindex key index)
(linsert key before-after pivot value)
(llen key)
(lpop key)
(lpush key value)
(lpushx key value & values)
(lrange key start end)
(lrem key count value)
(lset key value index)
(ltrim key start stop)
(mget key & keys)
(monitor)
(move key db)
(mset key value & pairs)
(msetnx key value & pairs)
(multi)
(object subcommand & arguments)
(open-channel conn command channels)
Takes a connection and sets up a connection to a Redis channel with the provided functions as callbacks to invoke when messages are received
Takes a connection and sets up a connection to a Redis channel with the provided functions as callbacks to invoke when messages are received
(parameters params)
This function enables vararg style definitions in the queries. For example you can write:
(mget [key & keys])
and the defquery macro will properly expand out into a variable argument function
This function enables vararg style definitions in the queries. For example you can write: (mget [key & keys]) and the defquery macro will properly expand out into a variable argument function
(persist key)
(ping)
(publish channel message)
(query name & args)
The new unified protocol was introduced in Redis 1.2, but it became the standard way for talking with the Redis server in Redis 2.0. In the unified protocol all the arguments sent to the Redis server are binary safe. This is the general form:
*<number of arguments> CR LF
$<number of bytes of argument 1> CR LF
<argument data> CR LF
...
$<number of bytes of argument N> CR LF
<argument data> CR LF
See the following example:
*3
$3
SET
$5
mykey
$7
myvalue
This is how the above command looks as a quoted string, so that it is possible to see the exact value of every byte in the query:
The new [unified protocol][up] was introduced in Redis 1.2, but it became the standard way for talking with the Redis server in Redis 2.0. In the unified protocol all the arguments sent to the Redis server are binary safe. This is the general form: *<number of arguments> CR LF $<number of bytes of argument 1> CR LF <argument data> CR LF ... $<number of bytes of argument N> CR LF <argument data> CR LF See the following example: *3 $3 SET $5 mykey $7 myvalue This is how the above command looks as a quoted string, so that it is possible to see the exact value of every byte in the query: [up]: http://redis.io/topics/protocol
(quit)
(randomkey)
(receive-message channel-spec in)
Used in conjunction with an open channel to handle messages that arrive. Takes a channel spec and a message
Used in conjunction with an open channel to handle messages that arrive. Takes a channel spec and a message
(rename key newkey)
(renamenx key newkey)
(request conn & query)
Responsible for actually making the request to the Redis server. Sets the timeout on the socket if one was specified.
Responsible for actually making the request to the Redis server. Sets the timeout on the socket if one was specified.
Redis will reply to commands with different kinds of replies. It is possible to check the kind of reply from the first byte sent by the server:
+
-
:
$
*
Redis will reply to commands with different kinds of replies. It is possible to check the kind of reply from the first byte sent by the server: * With a single line reply the first byte of the reply will be `+` * With an error message the first byte of the reply will be `-` * With an integer number the first byte of the reply will be `:` * With bulk reply the first byte of the reply will be `$` * With multi-bulk reply the first byte of the reply will be `*`
(rpop key)
(rpoplpush source destination)
(rpush key value & values)
(rpushx key value)
(sadd key member & members)
(save)
(scard key)
(sdiff key & keys)
(sdiffstore destination set1 set2)
(select index)
(set key value)
(setbit key offset value)
(setex key seconds value)
(setnx key value)
(setrange key offset value)
(shutdown)
(sinter key & keys)
(sinterstore destination key & keys)
(sismember key member)
(slaveof host port)
(slowlog command argument)
(smembers key)
(smove source desination member)
(sort key & options)
(spop key)
(srandmember key)
(srem key member & members)
(strlen key)
(sunion key & keys)
(sunionstore destination key & keys)
(sync)
(ttl key)
(type key)
(unwatch)
(watch key & keys)
(with-connection spec & body)
(write-commands out command channels)
Sends commands out to the specified channels
Sends commands out to the specified channels
(zadd key score member & more)
(zcard key)
(zcount key min max)
(zincrby key increment member)
(zinterstore dest-key source-keys & options)
(zrange key start stop)
(zrangebyscore key min max & more)
(zrank member)
(zrem key member & members)
(zremrangebyrank key start stop)
(zremrangebyscore key min max)
(zrevrange key start stop & more)
(zrevrangebyscore key max min & more)
(zrevrank key member)
(zscore key member)
(zunionstore dest-key source-keys & options)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close