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.authFunction
auth(password[, username])

Authenticate to the server.

source
Jedis.selectFunction
select(database)

Change the selected database for the current connection.

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

Remove all keys from the current database.

source
Jedis.keysFunction
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.setexFunction
setex(key, seconds, value)

Set the value and expiration of a key.

source
Jedis.multiFunction
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.execFunction
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_execFunction
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.hsetFunction
hset(key, field, value)

Set the string value of a hash field.

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

Get the values of all the given hash fields.

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

Delete one or more hash fields.

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

Prepend one or multiple elements to a list.

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

Append one or multiple elements to a list.

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

Return the index of matching element on a list.

source
Jedis.lremFunction
lrem(key, count, element)

Remove elements from a list.

source
Jedis.lpopFunction
lpop(key)

Remove and get the first element in a list.

source
Jedis.rpopFunction
rpop(key)

Remove and get the last element in a list.

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

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

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

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

source
Jedis.lrangeFunction
lrange(key, start, stop)

Get a range of elements from a list.

source
Jedis.incrFunction
incr(key)

Increment the integer value of a key by one.

source
Jedis.incrbyFunction
incrby(key, increment)

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

source
Jedis.incrbyfloatFunction
incrbyfloat(key, increment)

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

source
Jedis.hincrbyFunction
hincrby(key, field, increment)

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

source
Jedis.hincrbyfloatFunction
hincrbyfloat(key, field, increment)

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

source
Jedis.zincrbyFunction
zincrby(key, field, member)

Increment the score of a member in a sorted set.

source