Rediscl.Query (rediscl v0.3.0) View Source

Minimal redis command

Link to this section Summary

Functions

Run a command

Run a command with key

Key is exists

Get a key redis client

Force et a key redis client

Left push for list with key and values

Get for list with given key and start indx and stop index

Remove from list element with given key and element count

Set from list with given key and index and value

Multiple get a value with given keys redis client

Multiple set a keys and values redis clients

Pipe queries

Right push for list with key and values

Set a key, single value redis client

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

Gets the number of members in a sorted set.

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

Increments the score of a member in a sorted set.

Intersects multiple sorted sets and returns the resulting sorted set.

Intersects multiple sorted sets and stores the resulting sorted set in a new key.

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

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

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

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

Determines the index of a member in a sorted set.

Removes one or more members from a sorted set.

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

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

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

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

Returns a range of members in a sorted set, by lexicographical range, with lexicographical ranges ordered from high to low.

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

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

Incrementally iterates sorted sets elements and associated scores.

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

Adds multiple sorted sets and returns the resulting sorted set.

Adds multiple sorted sets and stores the resulting sorted set in a new key.

Link to this section Functions

Link to this function

append(key, value, opts \\ [])

View Source

Run a command

Link to this function

command(command, key, opts \\ [])

View Source

Run a command with key

Link to this function

decr_by(key, decrement, opts \\ [])

View Source

Del a keys

Key is exists

Get a key redis client

Force et a key redis client

Link to this function

get_range(key, start, stop, opts \\ [])

View Source
Link to this function

get_set(key, value, opts \\ [])

View Source
Link to this function

incr_by(key, value, opts \\ [])

View Source
Link to this function

incr_by_float(key, value, opts \\ [])

View Source
Link to this function

lpush(key, value, opts \\ [])

View Source

Left push for list with key and values

Link to this function

lrange(key, start, stop, opts \\ [])

View Source

Get for list with given key and start indx and stop index

Link to this function

lrem(key, count, value, opts \\ [])

View Source

Remove from list element with given key and element count

Link to this function

lset(key, index, value, opts \\ [])

View Source

Set from list with given key and index and value

Multiple get a value with given keys redis client

Link to this function

mset(keys_and_values, opts \\ [])

View Source

Multiple set a keys and values redis clients

Link to this function

mset_nx(keys_and_values, opts \\ [])

View Source

Pipe queries

Link to this function

pset_ex(key, milisecond, value, opts \\ [])

View Source
Link to this function

rpush(key, value, opts \\ [])

View Source

Right push for list with key and values

Specs

run_pipe(List.t()) :: {:ok, Rediscl.Query.Pipe.t()}
Link to this function

sadd(key, values, opts \\ [])

View Source
Link to this function

sdiffstore(key, keys, opts \\ [])

View Source
Link to this function

set(key, value, opts \\ [])

View Source

Set a key, single value redis client

Link to this function

set_ex(key, second, value, opts \\ [])

View Source
Link to this function

set_nx(key, value, opts \\ [])

View Source
Link to this function

set_range(key, offset, value, opts \\ [])

View Source
Link to this function

sinter(keys, opts \\ [])

View Source
Link to this function

sinterstore(key, keys, opts \\ [])

View Source
Link to this function

sismember(key, value, opts \\ [])

View Source
Link to this function

smembers(key, opts \\ [])

View Source
Link to this function

smove(key_one, key_two, value, opts \\ [])

View Source
Link to this function

spop(key, count \\ nil, opts \\ [])

View Source
Link to this function

srandmember(key, count \\ nil, opts \\ [])

View Source
Link to this function

srem(key, value_or_values, opts \\ [])

View Source
Link to this function

sscan(key, values, opts \\ [])

View Source
Link to this function

sunion(keys, opts \\ [])

View Source
Link to this function

sunionstore(key, keys, opts \\ [])

View Source
Link to this function

zadd(key, score, value, opts \\ [])

View Source

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

Examples

iex> Rediscl.Query.zadd("key", 1, "value")
{:ok, "1"}

Gets the number of members in a sorted set.

Examples

iex> Rediscl.Query.zadd("key", 1, "value1")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 1, "value2")
{:ok, "1"}
iex> Rediscl.Query.zcard("key")
{:ok, "2"}
Link to this function

zcount(key, min, max, opts \\ [])

View Source

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

Examples

iex> Rediscl.Query.zadd("key", 1, "value1")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 1, "value2")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 2, "value3")
{:ok, "1"}
iex> Rediscl.Query.zcount("key", 1, 2)
{:ok, "3"}
Link to this function

zincrby(key, increment, value, opts \\ [])

View Source

Increments the score of a member in a sorted set.

Examples

iex> Rediscl.Query.zadd("key", 1, "value1")
{:ok, "1"}
iex> Rediscl.Query.zincrby("key", 5, "value1")
{:ok, "6"}
Link to this function

zinter(keys, opts \\ [])

View Source

Intersects multiple sorted sets and returns the resulting sorted set.

Examples

iex> Rediscl.Query.zadd("key1", 1, "value1")
{:ok, "1"}
iex> Rediscl.Query.zadd("key2", 1, "value1")
{:ok, "1"}
iex> Rediscl.Query.zadd("key2", 2, "value2")
{:ok, "1"}
iex> Rediscl.Query.zinter(["key1", "key2"])
{:ok, ["value1"]}
Link to this function

zinterstore(key, keys, opts \\ [])

View Source

Intersects multiple sorted sets and stores the resulting sorted set in a new key.

Examples

iex> Rediscl.Query.zadd("key1", 1, "value1")
{:ok, "1"}
iex> Rediscl.Query.zadd("key2", 1, "value1")
{:ok, "1"}
iex> Rediscl.Query.zadd("key2", 2, "value2")
{:ok, "1"}
iex> Rediscl.Query.zinterstore("out", ["key1", "key2"])
{:ok, "1"}
Link to this function

zlexcount(key, min, max, opts \\ [])

View Source

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

Examples

iex> Rediscl.Query.zadd("key", 0, "a")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "b")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "c")
{:ok, "1"}
iex> Rediscl.Query.zlexcount("key", "[b", "[c")
{:ok, "2"}
Link to this function

zrange(key, min, max, opts \\ [])

View Source

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

Examples

iex> Rediscl.Query.zadd("key", 0, "a")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "b")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "c")
{:ok, "1"}
iex> Rediscl.Query.zrange("key", 0, -1)
{:ok, ["a", "b", "c"]}
Link to this function

zrangebylex(key, min, max, opts \\ [])

View Source

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

Examples

iex> Rediscl.Query.zadd("key", 0, "a")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "b")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "c")
{:ok, "1"}
iex> Rediscl.Query.zrangebylex("key", "[a", "[c")
{:ok, ["a", "b", "c"]}
Link to this function

zrangebyscore(key, min, max, opts \\ [])

View Source

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

Examples

iex> Rediscl.Query.zadd("key", 0, "a")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "b")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "c")
{:ok, "1"}
iex> Rediscl.Query.zrangebyscore("key", 0, 0)
{:ok, ["a", "b", "c"]}
Link to this function

zrank(key, value, opts \\ [])

View Source

Determines the index of a member in a sorted set.

Examples

iex> Rediscl.Query.zadd("key", 0, "a")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "b")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "c")
{:ok, "1"}
iex> Rediscl.Query.zrank("key", "b")
{:ok, "1"}
Link to this function

zrem(key, value, opts \\ [])

View Source

Removes one or more members from a sorted set.

Examples

iex> Rediscl.Query.zadd("key", 0, "a")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "b")
{:ok, "1"}
iex> Rediscl.Query.zrem("key", "a")
{:ok, "1"}
Link to this function

zremrangebylex(key, min, max, opts \\ [])

View Source

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

Examples

iex> Rediscl.Query.zadd("key", 0, "a")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "b")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "c")
{:ok, "1"}
iex> Rediscl.Query.zremrangebylex("key", "[a", "[c")
{:ok, "3"}
Link to this function

zremrangebyrank(key, min, max, opts \\ [])

View Source

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

Examples

iex> Rediscl.Query.zadd("key", 0, "a")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "b")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "c")
{:ok, "1"}
iex> Rediscl.Query.zremrangebyrank("key", 0, 2)
{:ok, "3"}
Link to this function

zremrangebyscore(key, min, max, opts \\ [])

View Source

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

Examples

iex> Rediscl.Query.zadd("key", 0, "a")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "b")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "c")
{:ok, "1"}
iex> Rediscl.Query.zremrangebyscore("key", 0, 0)
{:ok, "3"}
Link to this function

zrevrange(key, min, max, opts \\ [])

View Source

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

Examples

iex> Rediscl.Query.zadd("key", 0, "a")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "b")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "c")
{:ok, "1"}
iex> Rediscl.Query.zrevrange("key", 0, -1)
{:ok, ["c", "b", "a"]}
Link to this function

zrevrangebylex(key, max, min, opts \\ [])

View Source

Returns a range of members in a sorted set, by lexicographical range, with lexicographical ranges ordered from high to low.

Examples

iex> Rediscl.Query.zadd("key", 0, "a")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "b")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "c")
{:ok, "1"}
iex> Rediscl.Query.zrevrangebylex("key", "[c", "[a")
{:ok, ["c", "b", "a"]}
Link to this function

zrevrangebyscore(key, max, min, opts \\ [])

View Source

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

Examples

iex> Rediscl.Query.zadd("key", 0, "a")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "b")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "c")
{:ok, "1"}
iex> Rediscl.Query.zrevrangebyscore("key", 0, 0)
{:ok, ["c", "b", "a"]}
Link to this function

zrevrank(key, value, opts \\ [])

View Source

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

Examples

iex> Rediscl.Query.zadd("key", 0, "a")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "b")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 0, "c")
{:ok, "1"}
iex> Rediscl.Query.zrevrank("key", "a")
{:ok, "2"}
Link to this function

zscan(key, values, opts \\ [])

View Source

Incrementally iterates sorted sets elements and associated scores.

Examples

iex> Rediscl.Query.zadd("key", 1, "value1")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 1, "value2")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 1, "oldvalue1")
{:ok, "1"}
iex> Rediscl.Query.zadd("key", 1, "anohter1")
{:ok, "1"}
iex> Rediscl.Query.zscan("key, "[0, "match", "anohter*"])
{:ok, ["0", ["anohter1", "1"]]}
Link to this function

zscore(key, value, opts \\ [])

View Source

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

Examples

iex> Rediscl.Query.zadd("key", 4, "a")
{:ok, "1"}
iex> Rediscl.Query.zscore("key", "a")
{:ok, "4"}
Link to this function

zunion(keys, opts \\ [])

View Source

Adds multiple sorted sets and returns the resulting sorted set.

Examples

iex> Rediscl.Query.zadd("key1", 1, "value1")
{:ok, "1"}
iex> Rediscl.Query.zadd("key2", 1, "value1")
{:ok, "1"}
iex> Rediscl.Query.zadd("key2", 2, "value2")
{:ok, "1"}
iex> Rediscl.Query.zunion(["key1", "key2"])
{:ok, ["value1", "value2"]}
Link to this function

zunionstore(key, keys, opts \\ [])

View Source

Adds multiple sorted sets and stores the resulting sorted set in a new key.

Examples

iex> Rediscl.Query.zadd("key1", 1, "value1")
{:ok, "1"}
iex> Rediscl.Query.zadd("key2", 1, "value1")
{:ok, "1"}
iex> Rediscl.Query.zadd("key2", 2, "value2")
{:ok, "1"}
iex> Rediscl.Query.zunionstore("out", ["key1", "key2"])
{:ok, "2"}