redis v0.1.0 Redis

Redis commands for Elixir

Link to this section Summary

Types

Redis key, extracted into separate type to support variadic arguments

Redis pattern

Unix timestamp in seconds

Variadic argument, when argument values count should equals key/0 count in command

Functions

Append a value to a key

Authenticate to the server

Asynchronously rewrite the append-only file

Asynchronously save the dataset to disk

Count set bits in a string

Perform arbitrary bitfield integer operations on strings

Perform bitwise operations between strings

Find first bit set or clear in a string

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

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

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

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

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

Get the current connection name

Returns the client ID for the current connection

Kill the connection of a client

Get the list of client connections

Stop processing commands from clients for some time

Instruct the server whether to reply to commands

Set the current connection name

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

Assign new hash slots to receiving node

Return the number of failure reports active for a given node

Return the number of local keys in the specified hash slot

Set hash slots as unbound in receiving node

Forces a replica to perform a manual failover of its master

Remove a node from the nodes table

Return local key names in the specified hash slot

Provides info about Redis Cluster node state

Returns the hash slot of the specified key

Force a node cluster to handshake with another node

Get Cluster config for the node

List replica nodes of the specified master node

Reconfigure a node as a replica of the specified master node

Reset a Redis Cluster node

Forces the node to save cluster state on disk

Set the configuration epoch in a new node

Bind a hash slot to a specific node

List replica nodes of the specified master node

Get array of Cluster slot to node mappings

Get array of Redis command details

Get total number of Redis commands

Extract keys given a full Redis command

Get array of specific Redis command details

Get the value of a configuration parameter

Reset the stats returned by INFO

Rewrite the configuration file with the in memory configuration

Set a configuration parameter to the given value

Return the number of keys in the selected database

Get debugging information about a key

Make the server crash

Decrement the integer value of a key by one

Decrement the integer value of a key by the given number

Delete a key

Discard all commands issued after MULTI

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

Echo the given string

Execute a Lua script server side

Execute a Lua script server side

Execute all commands issued after MULTI

Determine if a key exists

Set a key’s time to live in seconds

Set the expiration for a key as a UNIX timestamp

Remove all keys from all databases

Remove all keys from the current database

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

Returns the distance between two members of a geospatial index

Returns members of a geospatial index as standard geohash strings

Returns longitude and latitude of members of a geospatial index

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

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

Get the value of a key

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

Get a substring of the string stored at a key

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

Delete one or more hash fields

Determine if a hash field exists

Get the value of a hash field

Get all the fields and values in a hash

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

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

Get all the fields in a hash

Get the number of fields in a hash

Get the values of all the given hash fields

Set multiple hash fields to multiple values

Incrementally iterate hash fields and associated values

Set the string value of a hash field

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

Get the length of the value of a hash field

Get all the values in a hash

Increment the integer value of a key by one

Increment the integer value of a key by the given amount

Increment the float value of a key by the given amount

Get information and statistics about the server

Find all keys matching the given pattern

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

Get an element from a list by its index

Insert an element before or after another element in a list

Get the length of a list

Remove and get the first element in a list

Prepend one or multiple values to a list

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

Get a range of elements from a list

Remove elements from a list

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

Trim a list to the specified range

Outputs memory problems report

Show helpful text about the different subcommands

Show allocator internal stats

Ask the allocator to release memory

Show memory usage details

Estimate the memory usage of a key

Get the values of all the given keys

Atomically transfer a key from a Redis instance to another one

Listen for all requests received by the server in real time

Move a key to another database

Set multiple keys to multiple values

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

Mark the start of a transaction block

Inspect the internals of Redis objects

Remove the expiration from a key

Set a key’s time to live in milliseconds

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

Adds the specified elements to the specified HyperLogLog

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

Merge N different HyperLogLogs into a single one

Ping the server

Set the value and expiration in milliseconds of a key

Listen for messages published to channels matching the given patterns

Get the time to live for a key in milliseconds

Post a message to a channel

Inspect the state of the Pub/Sub subsystem

Stop listening for messages posted to channels matching the given patterns

Close the connection

Return a random key from the keyspace

Enables read queries for a connection to a cluster replica node

Disables read queries for a connection to a cluster replica node

Rename a key

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

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

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

Return the role of the instance in the context of replication

Remove and get the last element in a list

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

Append one or multiple values to a list

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

Add one or more members to a set

Synchronously save the dataset to disk

Incrementally iterate the keys space

Get the number of members in a set

Set the debug mode for executed scripts

Check existence of scripts in the script cache

Remove all the scripts from the script cache

Kill the script currently in execution

Load the specified Lua script into the script cache

Subtract multiple sets

Subtract multiple sets and store the resulting set in a key

Change the selected database for the current connection

Set the string value of a key

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

Set the value and expiration of a key

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

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

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

Intersect multiple sets

Intersect multiple sets and store the resulting set in a key

Determine if a given value is a member of a set

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

Manages the Redis slow queries log

Get all the members in a set

Move a member from one set to another

Sort the elements in a list, set or sorted set

Remove and return one or multiple random members from a set

Get one or multiple random members from a set

Remove one or more members from a set

Incrementally iterate Set elements

Get the length of the value stored in a key

Listen for messages published to the given channels

Add multiple sets

Add multiple sets and store the resulting set in a key

Swaps two Redis databases

Internal command used for replication

Return the current server time

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

Get the time to live for a key

Determine the type stored at key

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

Stop listening for messages posted to the given channels

Forget about all watched keys

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

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

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

Appends a new entry to a stream

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

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

Create, destroy, and manage consumer groups

Get information on streams and consumer groups

Return the number of entires in a stream

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

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

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

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

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

Trims the stream to (approximately if ‘~’ is passed) a certain size

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

Get the number of members in a sorted set

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

Increment the score of a member in a sorted set

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

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

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

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

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

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

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

Determine the index of a member in a sorted set

Remove one or more members from a sorted set

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

Remove all members in a sorted set within the given indexes

Remove all members in a sorted set within the given scores

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

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

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

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

Incrementally iterate sorted sets elements and associated scores

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

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

Link to this section Types

Link to this type key()
key() :: String.t()

Redis key, extracted into separate type to support variadic arguments

Link to this type pattern()
pattern() :: String.t()

Redis pattern

Link to this type posix_time()
posix_time() :: non_neg_integer()

Unix timestamp in seconds

Link to this type variadic(value)
variadic(value) :: [value]

Variadic argument, when argument values count should equals key/0 count in command

Link to this section Functions

Link to this function append(key, value) (since 2.0.0)
append(key :: key(), value :: String.t()) :: iolist()

Append a value to a key

Group: string.

Link to this function auth(password) (since 1.0.0)
auth(password :: String.t()) :: iolist()

Authenticate to the server

Group: connection.

Link to this function bgrewriteaof() (since 1.0.0)
bgrewriteaof() :: iolist()

Asynchronously rewrite the append-only file

Group: server.

Link to this function bgsave() (since 1.0.0)
bgsave() :: iolist()

Asynchronously save the dataset to disk

Group: server.

Link to this function bitcount(key, opts \\ []) (since 2.6.0)
bitcount(key :: key(), opts :: [{:start_end, {integer(), integer()}}]) ::
  iolist()

Count set bits in a string

Group: string.

Link to this function bitfield(key, opts \\ []) (since 3.2.0)
bitfield(
  key :: key(),
  opts :: [
    get: {String.t(), integer()},
    set: {String.t(), integer(), integer()},
    incrby: {String.t(), integer(), integer()},
    overflow: :wrap | :sat | :fail
  ]
) :: iolist()

Perform arbitrary bitfield integer operations on strings

Group: string.

Link to this function bitop(operation, destkey, key) (since 2.6.0)
bitop(operation :: String.t(), destkey :: key(), key :: key()) :: iolist()

Perform bitwise operations between strings

Group: string.

Link to this function bitpos(key, bit, opts \\ []) (since 2.8.7)
bitpos(
  key :: key(),
  bit :: integer(),
  opts :: [start: integer(), end: integer()]
) :: iolist()

Find first bit set or clear in a string

Group: string.

Link to this function blpop(key, timeout) (since 2.0.0)
blpop(key :: key(), timeout :: integer()) :: iolist()

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

Group: list.

Link to this function brpop(key, timeout) (since 2.0.0)
brpop(key :: key(), timeout :: integer()) :: iolist()

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

Group: list.

Link to this function brpoplpush(source, destination, timeout) (since 2.2.0)
brpoplpush(source :: key(), destination :: key(), timeout :: integer()) ::
  iolist()

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

Group: list.

Link to this function bzpopmax(key, timeout) (since 5.0.0)
bzpopmax(key :: key(), timeout :: integer()) :: iolist()

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

Group: sorted_set.

Link to this function bzpopmin(key, timeout) (since 5.0.0)
bzpopmin(key :: key(), timeout :: integer()) :: iolist()

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

Group: sorted_set.

Link to this function client_getname() (since 2.6.9)
client_getname() :: iolist()

Get the current connection name

Group: server.

Link to this function client_id() (since 5.0.0)
client_id() :: iolist()

Returns the client ID for the current connection

Group: server.

Link to this function client_kill(opts \\ []) (since 2.4.0)
client_kill(
  opts :: [
    ip_port: String.t(),
    id: integer(),
    type: :normal | :master | :slave | :pubsub,
    addr: String.t(),
    skipme: String.t()
  ]
) :: iolist()

Kill the connection of a client

Group: server.

Link to this function client_list(opts \\ []) (since 2.4.0)
client_list(opts :: [{:type, :normal | :master | :replica | :pubsub}]) ::
  iolist()

Get the list of client connections

Group: server.

Link to this function client_pause(timeout) (since 2.9.50)
client_pause(timeout :: integer()) :: iolist()

Stop processing commands from clients for some time

Group: server.

Link to this function client_reply(reply_mode) (since 3.2)
client_reply(reply_mode :: :on | :off | :skip) :: iolist()

Instruct the server whether to reply to commands

Group: server.

Link to this function client_setname(connection_name) (since 2.6.9)
client_setname(connection_name :: String.t()) :: iolist()

Set the current connection name

Group: server.

Link to this function client_unblock(client_id, opts \\ []) (since 5.0.0)
client_unblock(
  client_id :: String.t(),
  opts :: [(:timeout | :error) | {:unblock_type, :timeout | :error}]
) :: iolist()

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

Group: server.

Link to this function cluster_addslots(slot) (since 3.0.0)
cluster_addslots(slot :: integer()) :: iolist()

Assign new hash slots to receiving node

Group: cluster.

Link to this function cluster_count_failure_reports(node_id) (since 3.0.0)
cluster_count_failure_reports(node_id :: String.t()) :: iolist()

Return the number of failure reports active for a given node

Group: cluster.

Link to this function cluster_countkeysinslot(slot) (since 3.0.0)
cluster_countkeysinslot(slot :: integer()) :: iolist()

Return the number of local keys in the specified hash slot

Group: cluster.

Link to this function cluster_delslots(slot) (since 3.0.0)
cluster_delslots(slot :: integer()) :: iolist()

Set hash slots as unbound in receiving node

Group: cluster.

Link to this function cluster_failover(opts \\ []) (since 3.0.0)
cluster_failover(
  opts :: [(:force | :takeover) | {:options, :force | :takeover}]
) :: iolist()

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

Group: cluster.

Link to this function cluster_forget(node_id) (since 3.0.0)
cluster_forget(node_id :: String.t()) :: iolist()

Remove a node from the nodes table

Group: cluster.

Link to this function cluster_getkeysinslot(slot, count) (since 3.0.0)
cluster_getkeysinslot(slot :: integer(), count :: integer()) :: iolist()

Return local key names in the specified hash slot

Group: cluster.

Link to this function cluster_info() (since 3.0.0)
cluster_info() :: iolist()

Provides info about Redis Cluster node state

Group: cluster.

Link to this function cluster_keyslot(key) (since 3.0.0)
cluster_keyslot(key :: String.t()) :: iolist()

Returns the hash slot of the specified key

Group: cluster.

Link to this function cluster_meet(ip, port) (since 3.0.0)
cluster_meet(ip :: String.t(), port :: integer()) :: iolist()

Force a node cluster to handshake with another node

Group: cluster.

Link to this function cluster_nodes() (since 3.0.0)
cluster_nodes() :: iolist()

Get Cluster config for the node

Group: cluster.

Link to this function cluster_replicas(node_id) (since 5.0.0)
cluster_replicas(node_id :: String.t()) :: iolist()

List replica nodes of the specified master node

Group: cluster.

Link to this function cluster_replicate(node_id) (since 3.0.0)
cluster_replicate(node_id :: String.t()) :: iolist()

Reconfigure a node as a replica of the specified master node

Group: cluster.

Link to this function cluster_reset(opts \\ []) (since 3.0.0)
cluster_reset(opts :: [(:hard | :soft) | {:reset_type, :hard | :soft}]) ::
  iolist()

Reset a Redis Cluster node

Group: cluster.

Link to this function cluster_saveconfig() (since 3.0.0)
cluster_saveconfig() :: iolist()

Forces the node to save cluster state on disk

Group: cluster.

Link to this function cluster_set_config_epoch(config_epoch) (since 3.0.0)
cluster_set_config_epoch(config_epoch :: integer()) :: iolist()

Set the configuration epoch in a new node

Group: cluster.

Link to this function cluster_setslot(slot, subcommand, opts \\ []) (since 3.0.0)
cluster_setslot(
  slot :: integer(),
  subcommand :: :importing | :migrating | :stable | :node,
  opts :: [{:node_id, String.t()}]
) :: iolist()

Bind a hash slot to a specific node

Group: cluster.

Link to this function cluster_slaves(node_id) (since 3.0.0)
cluster_slaves(node_id :: String.t()) :: iolist()

List replica nodes of the specified master node

Group: cluster.

Link to this function cluster_slots() (since 3.0.0)
cluster_slots() :: iolist()

Get array of Cluster slot to node mappings

Group: cluster.

Link to this function command() (since 2.8.13)
command() :: iolist()

Get array of Redis command details

Group: server.

Link to this function command_count() (since 2.8.13)
command_count() :: iolist()

Get total number of Redis commands

Group: server.

Link to this function command_getkeys() (since 2.8.13)
command_getkeys() :: iolist()

Extract keys given a full Redis command

Group: server.

Link to this function command_info(command_name) (since 2.8.13)
command_info(command_name :: String.t()) :: iolist()

Get array of specific Redis command details

Group: server.

Link to this function config_get(parameter) (since 2.0.0)
config_get(parameter :: String.t()) :: iolist()

Get the value of a configuration parameter

Group: server.

Link to this function config_resetstat() (since 2.0.0)
config_resetstat() :: iolist()

Reset the stats returned by INFO

Group: server.

Link to this function config_rewrite() (since 2.8.0)
config_rewrite() :: iolist()

Rewrite the configuration file with the in memory configuration

Group: server.

Link to this function config_set(parameter, value) (since 2.0.0)
config_set(parameter :: String.t(), value :: String.t()) :: iolist()

Set a configuration parameter to the given value

Group: server.

Link to this function dbsize() (since 1.0.0)
dbsize() :: iolist()

Return the number of keys in the selected database

Group: server.

Link to this function debug_object(key) (since 1.0.0)
debug_object(key :: key()) :: iolist()

Get debugging information about a key

Group: server.

Link to this function debug_segfault() (since 1.0.0)
debug_segfault() :: iolist()

Make the server crash

Group: server.

Link to this function decr(key) (since 1.0.0)
decr(key :: key()) :: iolist()

Decrement the integer value of a key by one

Group: string.

Link to this function decrby(key, decrement) (since 1.0.0)
decrby(key :: key(), decrement :: integer()) :: iolist()

Decrement the integer value of a key by the given number

Group: string.

Link to this function del(key) (since 1.0.0)
del(key :: key()) :: iolist()

Delete a key

Group: generic.

Link to this function discard() (since 2.0.0)
discard() :: iolist()

Discard all commands issued after MULTI

Group: transactions.

Link to this function dump(key) (since 2.6.0)
dump(key :: key()) :: iolist()

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

Group: generic.

Link to this function echo(message) (since 1.0.0)
echo(message :: String.t()) :: iolist()

Echo the given string

Group: connection.

Link to this function eval(script, numkeys, key, arg) (since 2.6.0)
eval(
  script :: String.t(),
  numkeys :: integer(),
  key :: key(),
  arg :: String.t()
) :: iolist()

Execute a Lua script server side

Group: scripting.

Link to this function evalsha(sha1, numkeys, key, arg) (since 2.6.0)
evalsha(
  sha1 :: String.t(),
  numkeys :: integer(),
  key :: key(),
  arg :: String.t()
) :: iolist()

Execute a Lua script server side

Group: scripting.

Link to this function exec() (since 1.2.0)
exec() :: iolist()

Execute all commands issued after MULTI

Group: transactions.

Link to this function exists(key) (since 1.0.0)
exists(key :: key()) :: iolist()

Determine if a key exists

Group: generic.

Link to this function expire(key, seconds) (since 1.0.0)
expire(key :: key(), seconds :: integer()) :: iolist()

Set a key’s time to live in seconds

Group: generic.

Link to this function expireat(key, timestamp) (since 1.2.0)
expireat(key :: key(), timestamp :: posix_time()) :: iolist()

Set the expiration for a key as a UNIX timestamp

Group: generic.

Link to this function flushall(opts \\ []) (since 1.0.0)
flushall(opts :: [:async]) :: iolist()

Remove all keys from all databases

Group: server.

Link to this function flushdb(opts \\ []) (since 1.0.0)
flushdb(opts :: [:async]) :: iolist()

Remove all keys from the current database

Group: server.

Link to this function geoadd(key, longitude_latitude_member) (since 3.2.0)
geoadd(
  key :: key(),
  longitude_latitude_member :: {float(), float(), String.t()}
) :: iolist()

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

Group: geo.

Link to this function geodist(key, member1, member2, opts \\ []) (since 3.2.0)
geodist(
  key :: key(),
  member1 :: String.t(),
  member2 :: String.t(),
  opts :: [{:unit, String.t()}]
) :: iolist()

Returns the distance between two members of a geospatial index

Group: geo.

Link to this function geohash(key, member) (since 3.2.0)
geohash(key :: key(), member :: String.t()) :: iolist()

Returns members of a geospatial index as standard geohash strings

Group: geo.

Link to this function geopos(key, member) (since 3.2.0)
geopos(key :: key(), member :: String.t()) :: iolist()

Returns longitude and latitude of members of a geospatial index

Group: geo.

Link to this function georadius(key, longitude, latitude, radius, unit, opts \\ []) (since 3.2.0)
georadius(
  key :: key(),
  longitude :: float(),
  latitude :: float(),
  radius :: float(),
  unit :: :m | :km | :ft | :mi,
  opts :: [
    :withcoord
    | :withdist
    | :withhash
    | {:count, integer()}
    | ((:asc | :desc) | {:order, :asc | :desc})
    | {:store, key()}
    | {:storedist, key()}
  ]
) :: iolist()

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

Group: geo.

Link to this function georadiusbymember(key, member, radius, unit, opts \\ []) (since 3.2.0)
georadiusbymember(
  key :: key(),
  member :: String.t(),
  radius :: float(),
  unit :: :m | :km | :ft | :mi,
  opts :: [
    :withcoord
    | :withdist
    | :withhash
    | {:count, integer()}
    | ((:asc | :desc) | {:order, :asc | :desc})
    | {:store, key()}
    | {:storedist, key()}
  ]
) :: iolist()

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

Group: geo.

Link to this function get(key) (since 1.0.0)
get(key :: key()) :: iolist()

Get the value of a key

Group: string.

Link to this function getbit(key, offset) (since 2.2.0)
getbit(key :: key(), offset :: integer()) :: iolist()

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

Group: string.

Link to this function getrange(key, start, end_) (since 2.4.0)
getrange(key :: key(), start :: integer(), end_ :: integer()) :: iolist()

Get a substring of the string stored at a key

Group: string.

Link to this function getset(key, value) (since 1.0.0)
getset(key :: key(), value :: String.t()) :: iolist()

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

Group: string.

Link to this function hdel(key, field) (since 2.0.0)
hdel(key :: key(), field :: String.t()) :: iolist()

Delete one or more hash fields

Group: hash.

Link to this function hexists(key, field) (since 2.0.0)
hexists(key :: key(), field :: String.t()) :: iolist()

Determine if a hash field exists

Group: hash.

Link to this function hget(key, field) (since 2.0.0)
hget(key :: key(), field :: String.t()) :: iolist()

Get the value of a hash field

Group: hash.

Link to this function hgetall(key) (since 2.0.0)
hgetall(key :: key()) :: iolist()

Get all the fields and values in a hash

Group: hash.

Link to this function hincrby(key, field, increment) (since 2.0.0)
hincrby(key :: key(), field :: String.t(), increment :: integer()) :: iolist()

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

Group: hash.

Link to this function hincrbyfloat(key, field, increment) (since 2.6.0)
hincrbyfloat(key :: key(), field :: String.t(), increment :: float()) ::
  iolist()

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

Group: hash.

Link to this function hkeys(key) (since 2.0.0)
hkeys(key :: key()) :: iolist()

Get all the fields in a hash

Group: hash.

Link to this function hlen(key) (since 2.0.0)
hlen(key :: key()) :: iolist()

Get the number of fields in a hash

Group: hash.

Link to this function hmget(key, field) (since 2.0.0)
hmget(key :: key(), field :: String.t()) :: iolist()

Get the values of all the given hash fields

Group: hash.

Link to this function hmset(key, field_value) (since 2.0.0)
hmset(key :: key(), field_value :: {String.t(), String.t()}) :: iolist()

Set multiple hash fields to multiple values

Group: hash.

Link to this function hscan(key, cursor, opts \\ []) (since 2.8.0)
hscan(
  key :: key(),
  cursor :: integer(),
  opts :: [match: pattern(), count: integer()]
) :: iolist()

Incrementally iterate hash fields and associated values

Group: hash.

Link to this function hset(key, field, value) (since 2.0.0)
hset(key :: key(), field :: String.t(), value :: String.t()) :: iolist()

Set the string value of a hash field

Group: hash.

Link to this function hsetnx(key, field, value) (since 2.0.0)
hsetnx(key :: key(), field :: String.t(), value :: String.t()) :: iolist()

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

Group: hash.

Link to this function hstrlen(key, field) (since 3.2.0)
hstrlen(key :: key(), field :: String.t()) :: iolist()

Get the length of the value of a hash field

Group: hash.

Link to this function hvals(key) (since 2.0.0)
hvals(key :: key()) :: iolist()

Get all the values in a hash

Group: hash.

Link to this function incr(key) (since 1.0.0)
incr(key :: key()) :: iolist()

Increment the integer value of a key by one

Group: string.

Link to this function incrby(key, increment) (since 1.0.0)
incrby(key :: key(), increment :: integer()) :: iolist()

Increment the integer value of a key by the given amount

Group: string.

Link to this function incrbyfloat(key, increment) (since 2.6.0)
incrbyfloat(key :: key(), increment :: float()) :: iolist()

Increment the float value of a key by the given amount

Group: string.

Link to this function info(opts \\ []) (since 1.0.0)
info(opts :: [{:section, String.t()}]) :: iolist()

Get information and statistics about the server

Group: server.

Link to this function keys(pattern) (since 1.0.0)
keys(pattern :: pattern()) :: iolist()

Find all keys matching the given pattern

Group: generic.

Link to this function lastsave() (since 1.0.0)
lastsave() :: iolist()

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

Group: server.

Link to this function lindex(key, index) (since 1.0.0)
lindex(key :: key(), index :: integer()) :: iolist()

Get an element from a list by its index

Group: list.

Link to this function linsert(key, where, pivot, value) (since 2.2.0)
linsert(
  key :: key(),
  where :: :before | :after,
  pivot :: String.t(),
  value :: String.t()
) :: iolist()

Insert an element before or after another element in a list

Group: list.

Link to this function llen(key) (since 1.0.0)
llen(key :: key()) :: iolist()

Get the length of a list

Group: list.

Link to this function lpop(key) (since 1.0.0)
lpop(key :: key()) :: iolist()

Remove and get the first element in a list

Group: list.

Link to this function lpush(key, value) (since 1.0.0)
lpush(key :: key(), value :: String.t()) :: iolist()

Prepend one or multiple values to a list

Group: list.

Link to this function lpushx(key, value) (since 2.2.0)
lpushx(key :: key(), value :: String.t()) :: iolist()

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

Group: list.

Link to this function lrange(key, start, stop) (since 1.0.0)
lrange(key :: key(), start :: integer(), stop :: integer()) :: iolist()

Get a range of elements from a list

Group: list.

Link to this function lrem(key, count, value) (since 1.0.0)
lrem(key :: key(), count :: integer(), value :: String.t()) :: iolist()

Remove elements from a list

Group: list.

Link to this function lset(key, index, value) (since 1.0.0)
lset(key :: key(), index :: integer(), value :: String.t()) :: iolist()

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

Group: list.

Link to this function ltrim(key, start, stop) (since 1.0.0)
ltrim(key :: key(), start :: integer(), stop :: integer()) :: iolist()

Trim a list to the specified range

Group: list.

Link to this function memory_doctor() (since 4.0.0)
memory_doctor() :: iolist()

Outputs memory problems report

Group: server.

Link to this function memory_help() (since 4.0.0)
memory_help() :: iolist()

Show helpful text about the different subcommands

Group: server.

Link to this function memory_malloc_stats() (since 4.0.0)
memory_malloc_stats() :: iolist()

Show allocator internal stats

Group: server.

Link to this function memory_purge() (since 4.0.0)
memory_purge() :: iolist()

Ask the allocator to release memory

Group: server.

Link to this function memory_stats() (since 4.0.0)
memory_stats() :: iolist()

Show memory usage details

Group: server.

Link to this function memory_usage(key, opts \\ []) (since 4.0.0)
memory_usage(key :: key(), opts :: [{:samples, integer()}]) :: iolist()

Estimate the memory usage of a key

Group: server.

Link to this function mget(key) (since 1.0.0)
mget(key :: key()) :: iolist()

Get the values of all the given keys

Group: string.

Link to this function migrate(host, port, key, destination_db, timeout, opts \\ []) (since 2.6.0)
migrate(
  host :: String.t(),
  port :: String.t(),
  key :: key(),
  destination_db :: integer(),
  timeout :: integer(),
  opts :: [:copy | :replace | {:keys, variadic(key())}]
) :: iolist()

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

Group: generic.

Link to this function monitor() (since 1.0.0)
monitor() :: iolist()

Listen for all requests received by the server in real time

Group: server.

Link to this function move(key, db) (since 1.0.0)
move(key :: key(), db :: integer()) :: iolist()

Move a key to another database

Group: generic.

Link to this function mset(key_value) (since 1.0.1)
mset(key_value :: {key(), String.t()}) :: iolist()

Set multiple keys to multiple values

Group: string.

Link to this function msetnx(key_value) (since 1.0.1)
msetnx(key_value :: {key(), String.t()}) :: iolist()

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

Group: string.

Link to this function multi() (since 1.2.0)
multi() :: iolist()

Mark the start of a transaction block

Group: transactions.

Link to this function object(subcommand, opts \\ []) (since 2.2.3)
object(subcommand :: String.t(), opts :: [{:arguments, String.t()}]) :: iolist()

Inspect the internals of Redis objects

Group: generic.

Link to this function persist(key) (since 2.2.0)
persist(key :: key()) :: iolist()

Remove the expiration from a key

Group: generic.

Link to this function pexpire(key, milliseconds) (since 2.6.0)
pexpire(key :: key(), milliseconds :: integer()) :: iolist()

Set a key’s time to live in milliseconds

Group: generic.

Link to this function pexpireat(key, milliseconds_timestamp) (since 2.6.0)
pexpireat(key :: key(), milliseconds_timestamp :: posix_time()) :: iolist()

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

Group: generic.

Link to this function pfadd(key, element) (since 2.8.9)
pfadd(key :: key(), element :: String.t()) :: iolist()

Adds the specified elements to the specified HyperLogLog.

Group: hyperloglog.

Link to this function pfcount(key) (since 2.8.9)
pfcount(key :: key()) :: iolist()

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

Group: hyperloglog.

Link to this function pfmerge(destkey, sourcekey) (since 2.8.9)
pfmerge(destkey :: key(), sourcekey :: key()) :: iolist()

Merge N different HyperLogLogs into a single one.

Group: hyperloglog.

Link to this function ping(opts \\ []) (since 1.0.0)
ping(opts :: [{:message, String.t()}]) :: iolist()

Ping the server

Group: connection.

Link to this function psetex(key, milliseconds, value) (since 2.6.0)
psetex(key :: key(), milliseconds :: integer(), value :: String.t()) ::
  iolist()

Set the value and expiration in milliseconds of a key

Group: string.

Link to this function psubscribe(pattern) (since 2.0.0)
psubscribe(pattern :: [pattern()]) :: iolist()

Listen for messages published to channels matching the given patterns

Group: pubsub.

Link to this function pttl(key) (since 2.6.0)
pttl(key :: key()) :: iolist()

Get the time to live for a key in milliseconds

Group: generic.

Link to this function publish(channel, message) (since 2.0.0)
publish(channel :: String.t(), message :: String.t()) :: iolist()

Post a message to a channel

Group: pubsub.

Link to this function pubsub(subcommand, opts \\ []) (since 2.8.0)
pubsub(subcommand :: String.t(), opts :: [{:argument, String.t()}]) :: iolist()

Inspect the state of the Pub/Sub subsystem

Group: pubsub.

Link to this function punsubscribe(opts \\ []) (since 2.0.0)
punsubscribe(opts :: [{:pattern, pattern()}]) :: iolist()

Stop listening for messages posted to channels matching the given patterns

Group: pubsub.

Link to this function quit() (since 1.0.0)
quit() :: iolist()

Close the connection

Group: connection.

Link to this function randomkey() (since 1.0.0)
randomkey() :: iolist()

Return a random key from the keyspace

Group: generic.

Link to this function readonly() (since 3.0.0)
readonly() :: iolist()

Enables read queries for a connection to a cluster replica node

Group: cluster.

Link to this function readwrite() (since 3.0.0)
readwrite() :: iolist()

Disables read queries for a connection to a cluster replica node

Group: cluster.

Link to this function rename(key, newkey) (since 1.0.0)
rename(key :: key(), newkey :: key()) :: iolist()

Rename a key

Group: generic.

Link to this function renamenx(key, newkey) (since 1.0.0)
renamenx(key :: key(), newkey :: key()) :: iolist()

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

Group: generic.

Link to this function replicaof(host, port) (since 5.0.0)
replicaof(host :: String.t(), port :: String.t()) :: iolist()

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

Group: server.

Link to this function restore(key, ttl, serialized_value, opts \\ []) (since 2.6.0)
restore(
  key :: key(),
  ttl :: integer(),
  serialized_value :: String.t(),
  opts :: [:replace]
) :: iolist()

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

Group: generic.

Link to this function role() (since 2.8.12)
role() :: iolist()

Return the role of the instance in the context of replication

Group: server.

Link to this function rpop(key) (since 1.0.0)
rpop(key :: key()) :: iolist()

Remove and get the last element in a list

Group: list.

Link to this function rpoplpush(source, destination) (since 1.2.0)
rpoplpush(source :: key(), destination :: key()) :: iolist()

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

Group: list.

Link to this function rpush(key, value) (since 1.0.0)
rpush(key :: key(), value :: String.t()) :: iolist()

Append one or multiple values to a list

Group: list.

Link to this function rpushx(key, value) (since 2.2.0)
rpushx(key :: key(), value :: String.t()) :: iolist()

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

Group: list.

Link to this function sadd(key, member) (since 1.0.0)
sadd(key :: key(), member :: String.t()) :: iolist()

Add one or more members to a set

Group: set.

Link to this function save() (since 1.0.0)
save() :: iolist()

Synchronously save the dataset to disk

Group: server.

Link to this function scan(cursor, opts \\ []) (since 2.8.0)
scan(cursor :: integer(), opts :: [match: pattern(), count: integer()]) ::
  iolist()

Incrementally iterate the keys space

Group: generic.

Link to this function scard(key) (since 1.0.0)
scard(key :: key()) :: iolist()

Get the number of members in a set

Group: set.

Link to this function script_debug(mode) (since 3.2.0)
script_debug(mode :: :yes | :sync | :no) :: iolist()

Set the debug mode for executed scripts.

Group: scripting.

Link to this function script_exists(sha1) (since 2.6.0)
script_exists(sha1 :: String.t()) :: iolist()

Check existence of scripts in the script cache.

Group: scripting.

Link to this function script_flush() (since 2.6.0)
script_flush() :: iolist()

Remove all the scripts from the script cache.

Group: scripting.

Link to this function script_kill() (since 2.6.0)
script_kill() :: iolist()

Kill the script currently in execution.

Group: scripting.

Link to this function script_load(script) (since 2.6.0)
script_load(script :: String.t()) :: iolist()

Load the specified Lua script into the script cache.

Group: scripting.

Link to this function sdiff(key) (since 1.0.0)
sdiff(key :: key()) :: iolist()

Subtract multiple sets

Group: set.

Link to this function sdiffstore(destination, key) (since 1.0.0)
sdiffstore(destination :: key(), key :: key()) :: iolist()

Subtract multiple sets and store the resulting set in a key

Group: set.

Link to this function select(index) (since 1.0.0)
select(index :: integer()) :: iolist()

Change the selected database for the current connection

Group: connection.

Link to this function set(key, value, opts \\ []) (since 1.0.0)
set(
  key :: key(),
  value :: String.t(),
  opts :: [
    {:expiration, {:ex, :integer} | {:px, :integer}}
    | (:nx | :xx)
    | {:condition, :nx | :xx}
  ]
) :: iolist()

Set the string value of a key

Group: string.

Link to this function setbit(key, offset, value) (since 2.2.0)
setbit(key :: key(), offset :: integer(), value :: String.t()) :: iolist()

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

Group: string.

Link to this function setex(key, seconds, value) (since 2.0.0)
setex(key :: key(), seconds :: integer(), value :: String.t()) :: iolist()

Set the value and expiration of a key

Group: string.

Link to this function setnx(key, value) (since 1.0.0)
setnx(key :: key(), value :: String.t()) :: iolist()

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

Group: string.

Link to this function setrange(key, offset, value) (since 2.2.0)
setrange(key :: key(), offset :: integer(), value :: String.t()) :: iolist()

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

Group: string.

Link to this function shutdown(opts \\ []) (since 1.0.0)
shutdown(opts :: [(:nosave | :save) | {:save_mode, :nosave | :save}]) ::
  iolist()

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

Group: server.

Link to this function sinter(key) (since 1.0.0)
sinter(key :: key()) :: iolist()

Intersect multiple sets

Group: set.

Link to this function sinterstore(destination, key) (since 1.0.0)
sinterstore(destination :: key(), key :: key()) :: iolist()

Intersect multiple sets and store the resulting set in a key

Group: set.

Link to this function sismember(key, member) (since 1.0.0)
sismember(key :: key(), member :: String.t()) :: iolist()

Determine if a given value is a member of a set

Group: set.

Link to this function slaveof(host, port) (since 1.0.0)
slaveof(host :: String.t(), port :: String.t()) :: iolist()

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

Group: server.

Link to this function slowlog(subcommand, opts \\ []) (since 2.2.12)
slowlog(subcommand :: String.t(), opts :: [{:argument, String.t()}]) :: iolist()

Manages the Redis slow queries log

Group: server.

Link to this function smembers(key) (since 1.0.0)
smembers(key :: key()) :: iolist()

Get all the members in a set

Group: set.

Link to this function smove(source, destination, member) (since 1.0.0)
smove(source :: key(), destination :: key(), member :: String.t()) :: iolist()

Move a member from one set to another

Group: set.

Link to this function sort(key, opts \\ []) (since 1.0.0)
sort(
  key :: key(),
  opts :: [
    {:by, pattern()}
    | {:limit, {integer(), integer()}}
    | {:get, String.t()}
    | ((:asc | :desc) | {:order, :asc | :desc})
    | (:alpha | {:sorting, :alpha})
    | {:store, key()}
  ]
) :: iolist()

Sort the elements in a list, set or sorted set

Group: generic.

Link to this function spop(key, opts \\ []) (since 1.0.0)
spop(key :: key(), opts :: [{:count, integer()}]) :: iolist()

Remove and return one or multiple random members from a set

Group: set.

Link to this function srandmember(key, opts \\ []) (since 1.0.0)
srandmember(key :: key(), opts :: [{:count, integer()}]) :: iolist()

Get one or multiple random members from a set

Group: set.

Link to this function srem(key, member) (since 1.0.0)
srem(key :: key(), member :: String.t()) :: iolist()

Remove one or more members from a set

Group: set.

Link to this function sscan(key, cursor, opts \\ []) (since 2.8.0)
sscan(
  key :: key(),
  cursor :: integer(),
  opts :: [match: pattern(), count: integer()]
) :: iolist()

Incrementally iterate Set elements

Group: set.

Link to this function strlen(key) (since 2.2.0)
strlen(key :: key()) :: iolist()

Get the length of the value stored in a key

Group: string.

Link to this function subscribe(channel) (since 2.0.0)
subscribe(channel :: [String.t()]) :: iolist()

Listen for messages published to the given channels

Group: pubsub.

Link to this function sunion(key) (since 1.0.0)
sunion(key :: key()) :: iolist()

Add multiple sets

Group: set.

Link to this function sunionstore(destination, key) (since 1.0.0)
sunionstore(destination :: key(), key :: key()) :: iolist()

Add multiple sets and store the resulting set in a key

Group: set.

Link to this function swapdb(index, index) (since 4.0.0)
swapdb(index :: integer(), index :: integer()) :: iolist()

Swaps two Redis databases

Group: connection.

Link to this function sync() (since 1.0.0)
sync() :: iolist()

Internal command used for replication

Group: server.

Link to this function time() (since 2.6.0)
time() :: iolist()

Return the current server time

Group: server.

Link to this function touch(key) (since 3.2.1)
touch(key :: key()) :: iolist()

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

Group: generic.

Link to this function ttl(key) (since 1.0.0)
ttl(key :: key()) :: iolist()

Get the time to live for a key

Group: generic.

Link to this function type(key) (since 1.0.0)
type(key :: key()) :: iolist()

Determine the type stored at key

Group: generic.

Link to this function unlink(key) (since 4.0.0)
unlink(key :: key()) :: iolist()

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

Group: generic.

Link to this function unsubscribe(opts \\ []) (since 2.0.0)
unsubscribe(opts :: [{:channel, String.t()}]) :: iolist()

Stop listening for messages posted to the given channels

Group: pubsub.

Link to this function unwatch() (since 2.2.0)
unwatch() :: iolist()

Forget about all watched keys

Group: transactions.

Link to this function wait(numreplicas, timeout) (since 3.0.0)
wait(numreplicas :: integer(), timeout :: integer()) :: iolist()

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

Group: generic.

Link to this function watch(key) (since 2.2.0)
watch(key :: key()) :: iolist()

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

Group: transactions.

Link to this function xack(key, group, id) (since 5.0.0)
xack(key :: key(), group :: String.t(), id :: String.t()) :: iolist()

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

Group: stream.

Link to this function xadd(key, id, field_string) (since 5.0.0)
xadd(key :: key(), id :: String.t(), field_string :: {String.t(), String.t()}) ::
  iolist()

Appends a new entry to a stream

Group: stream.

Link to this function xclaim(key, group, consumer, min_idle_time, id, opts \\ []) (since 5.0.0)
xclaim(
  key :: key(),
  group :: String.t(),
  consumer :: String.t(),
  min_idle_time :: String.t(),
  id :: String.t(),
  opts :: [
    {:idle, integer()}
    | {:time, integer()}
    | {:retrycount, integer()}
    | :force
    | :justid
  ]
) :: iolist()

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

Group: stream.

Link to this function xdel(key, id) (since 5.0.0)
xdel(key :: key(), id :: String.t()) :: iolist()

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

Group: stream.

Link to this function xgroup(opts \\ []) (since 5.0.0)
xgroup(
  opts :: [
    create: {key(), String.t(), String.t()},
    setid: {key(), String.t(), String.t()},
    destroy: {key(), String.t()},
    delconsumer: {key(), String.t(), String.t()}
  ]
) :: iolist()

Create, destroy, and manage consumer groups.

Group: stream.

Link to this function xinfo(opts \\ []) (since 5.0.0)
xinfo(
  opts :: [
    {:consumers, {key(), String.t()}}
    | {:groups, key()}
    | {:stream, key()}
    | :help
  ]
) :: iolist()

Get information on streams and consumer groups

Group: stream.

Link to this function xlen(key) (since 5.0.0)
xlen(key :: key()) :: iolist()

Return the number of entires in a stream

Group: stream.

Link to this function xpending(key, group, opts \\ []) (since 5.0.0)
xpending(
  key :: key(),
  group :: String.t(),
  opts :: [
    start_end_count: {String.t(), String.t(), integer()},
    consumer: String.t()
  ]
) :: iolist()

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

Group: stream.

Link to this function xrange(key, start, end_, opts \\ []) (since 5.0.0)
xrange(
  key :: key(),
  start :: String.t(),
  end_ :: String.t(),
  opts :: [{:count, integer()}]
) :: iolist()

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

Group: stream.

Link to this function xread(key, id, opts \\ []) (since 5.0.0)
xread(
  key :: key(),
  id :: String.t(),
  opts :: [{:count, integer()} | {:block, integer()} | :streams]
) :: iolist()

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

Group: stream.

Link to this function xreadgroup(group, key, id, opts \\ []) (since 5.0.0)
xreadgroup(
  group :: {String.t(), String.t()},
  key :: key(),
  id :: String.t(),
  opts :: [{:count, integer()} | {:block, integer()} | :noack | :streams]
) :: iolist()

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

Group: stream.

Link to this function xrevrange(key, end_, start, opts \\ []) (since 5.0.0)
xrevrange(
  key :: key(),
  end_ :: String.t(),
  start :: String.t(),
  opts :: [{:count, integer()}]
) :: iolist()

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

Group: stream.

Link to this function xtrim(key, count, opts \\ []) (since 5.0.0)
xtrim(
  key :: key(),
  count :: integer(),
  opts :: [(:maxlen | {:strategy, :maxlen}) | :"~" | {:approx, :"~"}]
) :: iolist()

Trims the stream to (approximately if ‘~’ is passed) a certain size

Group: stream.

Link to this function zadd(key, score_member, opts \\ []) (since 1.2.0)
zadd(
  key :: key(),
  score_member :: {float(), String.t()},
  opts :: [
    ((:nx | :xx) | {:condition, :nx | :xx})
    | (:ch | {:change, :ch})
    | :incr
    | {:increment, :incr}
  ]
) :: iolist()

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

Group: sorted_set.

Link to this function zcard(key) (since 1.2.0)
zcard(key :: key()) :: iolist()

Get the number of members in a sorted set

Group: sorted_set.

Link to this function zcount(key, min, max) (since 2.0.0)
zcount(key :: key(), min :: float(), max :: float()) :: iolist()

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

Group: sorted_set.

Link to this function zincrby(key, increment, member) (since 1.2.0)
zincrby(key :: key(), increment :: integer(), member :: String.t()) :: iolist()

Increment the score of a member in a sorted set

Group: sorted_set.

Link to this function zinterstore(destination, numkeys, key, opts \\ []) (since 2.0.0)
zinterstore(
  destination :: key(),
  numkeys :: integer(),
  key :: key(),
  opts :: [weights: variadic(integer()), aggregate: :sum | :min | :max]
) :: iolist()

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

Group: sorted_set.

Link to this function zlexcount(key, min, max) (since 2.8.9)
zlexcount(key :: key(), min :: String.t(), max :: String.t()) :: iolist()

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

Group: sorted_set.

Link to this function zpopmax(key, opts \\ []) (since 5.0.0)
zpopmax(key :: key(), opts :: [{:count, integer()}]) :: iolist()

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

Group: sorted_set.

Link to this function zpopmin(key, opts \\ []) (since 5.0.0)
zpopmin(key :: key(), opts :: [{:count, integer()}]) :: iolist()

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

Group: sorted_set.

Link to this function zrange(key, start, stop, opts \\ []) (since 1.2.0)
zrange(
  key :: key(),
  start :: integer(),
  stop :: integer(),
  opts :: [:withscores]
) :: iolist()

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

Group: sorted_set.

Link to this function zrangebylex(key, min, max, opts \\ []) (since 2.8.9)
zrangebylex(
  key :: key(),
  min :: String.t(),
  max :: String.t(),
  opts :: [{:limit, {integer(), integer()}}]
) :: iolist()

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

Group: sorted_set.

Link to this function zrangebyscore(key, min, max, opts \\ []) (since 1.0.5)
zrangebyscore(
  key :: key(),
  min :: float(),
  max :: float(),
  opts :: [:withscores | {:limit, {integer(), integer()}}]
) :: iolist()

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

Group: sorted_set.

Link to this function zrank(key, member) (since 2.0.0)
zrank(key :: key(), member :: String.t()) :: iolist()

Determine the index of a member in a sorted set

Group: sorted_set.

Link to this function zrem(key, member) (since 1.2.0)
zrem(key :: key(), member :: String.t()) :: iolist()

Remove one or more members from a sorted set

Group: sorted_set.

Link to this function zremrangebylex(key, min, max) (since 2.8.9)
zremrangebylex(key :: key(), min :: String.t(), max :: String.t()) :: iolist()

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

Group: sorted_set.

Link to this function zremrangebyrank(key, start, stop) (since 2.0.0)
zremrangebyrank(key :: key(), start :: integer(), stop :: integer()) ::
  iolist()

Remove all members in a sorted set within the given indexes

Group: sorted_set.

Link to this function zremrangebyscore(key, min, max) (since 1.2.0)
zremrangebyscore(key :: key(), min :: float(), max :: float()) :: iolist()

Remove all members in a sorted set within the given scores

Group: sorted_set.

Link to this function zrevrange(key, start, stop, opts \\ []) (since 1.2.0)
zrevrange(
  key :: key(),
  start :: integer(),
  stop :: integer(),
  opts :: [:withscores]
) :: iolist()

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

Group: sorted_set.

Link to this function zrevrangebylex(key, max, min, opts \\ []) (since 2.8.9)
zrevrangebylex(
  key :: key(),
  max :: String.t(),
  min :: String.t(),
  opts :: [{:limit, {integer(), integer()}}]
) :: iolist()

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

Group: sorted_set.

Link to this function zrevrangebyscore(key, max, min, opts \\ []) (since 2.2.0)
zrevrangebyscore(
  key :: key(),
  max :: float(),
  min :: float(),
  opts :: [:withscores | {:limit, {integer(), integer()}}]
) :: iolist()

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

Group: sorted_set.

Link to this function zrevrank(key, member) (since 2.0.0)
zrevrank(key :: key(), member :: String.t()) :: iolist()

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

Group: sorted_set.

Link to this function zscan(key, cursor, opts \\ []) (since 2.8.0)
zscan(
  key :: key(),
  cursor :: integer(),
  opts :: [match: pattern(), count: integer()]
) :: iolist()

Incrementally iterate sorted sets elements and associated scores

Group: sorted_set.

Link to this function zscore(key, member) (since 1.2.0)
zscore(key :: key(), member :: String.t()) :: iolist()

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

Group: sorted_set.

Link to this function zunionstore(destination, numkeys, key, opts \\ []) (since 2.0.0)
zunionstore(
  destination :: key(),
  numkeys :: integer(),
  key :: key(),
  opts :: [weights: variadic(integer()), aggregate: :sum | :min | :max]
) :: iolist()

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

Group: sorted_set.