Redis Commands

Jedis commands all share a common interface, if the client kwarg is not provided then the Jedis.GLOBAL_CLIENT instance will be used:

command(args...; kwargs..., client=get_global_client())

Full list of Jedis commands:

Jedis.auth — Function
auth(password[, username])

Authenticate to the server.

source
Jedis.select — Function
select(database)

Change the selected database for the current connection.

source
Jedis.flushdb — Function
flushdb([; async=false])

Remove all keys from the current database.

source
Jedis.keys — Function
keys(pattern)

Find all keys matching the pattern.

Julia 1.6

Jedis.keys is not exported as the interface conflicts with Base.keys.

source
Jedis.setex — Function
setex(key, seconds, value)

Set the value and expiration of a key.

source
Jedis.multi — Function
multi()

Mark the start of a transaction block.

Examples

julia> multi()
"OK"

julia> set("key", "value")
"QUEUED"

julia> get("key")
"QUEUED"

julia> exec()
2-element Array{String,1}:
 "OK"
 "value"
source
Jedis.exec — Function
exec()

Execute all commands issued after MULTI.

Examples

julia> multi()
"OK"

julia> set("key", "value")
"QUEUED"

julia> get("key")
"QUEUED"

julia> exec()
2-element Array{String,1}:
 "OK"
 "value"
source
Jedis.multi_exec — Function
multi_exec(fn::Function)

Execute a MULTI/EXEC transction in a do block.

Examples

julia> multi_exec() do 
           set("key", "value")
           get("key")
           get("key")
       end
3-element Array{String,1}:
 "OK"
 "value"
 "value"
source
Jedis.hset — Function
hset(key, field, value)

Set the string value of a hash field.

source
Jedis.hmget — Function
hmget(key, field[, fields...])

Get the values of all the given hash fields.

source
Jedis.hdel — Function
hdel(key, field[, fields...])

Delete one or more hash fields.

source
Jedis.lpush — Function
lpush(key, element[, elements...])

Prepend one or multiple elements to a list.

source
Jedis.rpush — Function
rpush(key, element[, elements...])

Append one or multiple elements to a list.

source
Jedis.lpos — Function
lpos(key, element[, rank, num_matches, len])

Return the index of matching element on a list.

source
Jedis.lrem — Function
lrem(key, count, element)

Remove elements from a list.

source
Jedis.lpop — Function
lpop(key)

Remove and get the first element in a list.

source
Jedis.rpop — Function
rpop(key)

Remove and get the last element in a list.

source
Jedis.blpop — Function
blpop(key[, key...; timeout=0])

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

source
Jedis.brpop — Function
brpop(key[, key...; timeout=0])

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

source
Jedis.lrange — Function
lrange(key, start, stop)

Get a range of elements from a list.

source
Jedis.incr — Function
incr(key)

Increment the integer value of a key by one.

source
Jedis.incrby — Function
incrby(key, increment)

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

source
Jedis.incrbyfloat — Function
incrbyfloat(key, increment)

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

source
Jedis.hincrby — Function
hincrby(key, field, increment)

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

source
Jedis.hincrbyfloat — Function
hincrbyfloat(key, field, increment)

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

source
Jedis.zincrby — Function
zincrby(key, field, member)

Increment the score of a member in a sorted set.

source