rediscl v0.2.11 Rediscl.Query View Source
Minimal redis command
Link to this section Summary
Functions
Run a command
Run a command with key
Del a keys
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
append(key, value, opts \\ []) View Source
command(command) View Source
Run a command
command(command, key, opts \\ []) View Source
Run a command with key
decr(key, opts \\ []) View Source
decr_by(key, decrement, opts \\ []) View Source
del(keys, opts \\ []) View Source
Del a keys
exists(key, opts \\ []) View Source
Key is exists
get(key, opts \\ []) View Source
Get a key redis client
get!(key, opts \\ []) View Source
Force et a key redis client
get_range(key, start, stop, opts \\ []) View Source
get_set(key, value, opts \\ []) View Source
incr(key, opts \\ []) View Source
incr_by(key, value, opts \\ []) View Source
incr_by_float(key, value, opts \\ []) View Source
lpush(key, value, opts \\ []) View Source
Left push for list with key and values
lrange(key, start, stop, opts \\ []) View Source
Get for list with given key and start indx and stop index
lrem(key, count, value, opts \\ []) View Source
Remove from list element with given key and element count
lset(key, index, value, opts \\ []) View Source
Set from list with given key and index and value
mget(keys, opts \\ []) View Source
Multiple get a value with given keys redis client
mset(keys_and_values, opts \\ []) View Source
Multiple set a keys and values redis clients
mset_nx(keys_and_values, opts \\ []) View Source
pipe(queries) View Source
Pipe queries
pset_ex(key, milisecond, value, opts \\ []) View Source
rpush(key, value, opts \\ []) View Source
Right push for list with key and values
run_pipe(pipes)
View Source
run_pipe(List.t()) :: {:ok, Rediscl.Query.Pipe.t()}
run_pipe(List.t()) :: {:ok, Rediscl.Query.Pipe.t()}
sadd(key, values, opts \\ []) View Source
scard(key, opts \\ []) View Source
sdiff(keys, opts \\ []) View Source
sdiffstore(key, keys, opts \\ []) View Source
set(key, value, opts \\ []) View Source
Set a key, single value redis client
set_ex(key, second, value, opts \\ []) View Source
set_nx(key, value, opts \\ []) View Source
set_range(key, offset, value, opts \\ []) View Source
sinter(keys, opts \\ []) View Source
sinterstore(key, keys, opts \\ []) View Source
sismember(key, value, opts \\ []) View Source
smembers(key, opts \\ []) View Source
smove(key_one, key_two, value, opts \\ []) View Source
spop(key, count \\ nil, opts \\ []) View Source
srandmember(key, count \\ nil, opts \\ []) View Source
srem(key, value_or_values, opts \\ []) View Source
sscan(key, values, opts \\ []) View Source
strlen(key, opts \\ []) View Source
sunion(keys, opts \\ []) View Source
sunionstore(key, keys, opts \\ []) View Source
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"}
zcard(key, opts \\ []) View Source
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"}
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"}
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"}
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"]}
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"}
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"}
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"]}
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"]}
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"]}
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"}
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"}
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"}
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"}
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"}
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"]}
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"]}
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"]}
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"}
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"]]}
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"}
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"]}
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"}