RedisSortedSet

play.api.cache.redis.RedisSortedSet
trait RedisSortedSet[Elem, Result[_]]

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Type members

Types

override type This = RedisSortedSet[Elem, Result]

Value members

Abstract methods

def add(scoreValues: (Double, Elem)*): Result[This]

Adds all the specified members with the specified scores to the sorted set stored at key. It is possible to specify multiple score / member pairs. If a specified member is already a member of the sorted set, the score is updated and the element reinserted at the right position to ensure the correct ordering.

Adds all the specified members with the specified scores to the sorted set stored at key. It is possible to specify multiple score / member pairs. If a specified member is already a member of the sorted set, the score is updated and the element reinserted at the right position to ensure the correct ordering.

If key does not exist, a new sorted set with the specified members as sole members is created, like if the sorted set was empty.

Value parameters

scoreValues

values and corresponding scores to be added

Attributes

Returns

the sorted set for chaining calls

Note

If the key exists but does not hold a sorted set, an error is returned.

Time complexity: O(log(N)) for each item added, where N is the number of elements in the sorted set.

def contains(element: Elem): Result[Boolean]

Tests if the element is contained in the sorted set. Returns true if exists, otherwise returns false

Tests if the element is contained in the sorted set. Returns true if exists, otherwise returns false

Value parameters

element

tested element

Attributes

Returns

true if exists in the set, otherwise false

Note

Time complexity: O(1)

def range(start: Long, stop: Long, isReverse: Boolean): Result[Seq[Elem]]

Returns the specified range of elements in the sorted set stored at key which sorted in order specified by param isReverse.

Returns the specified range of elements in the sorted set stored at key which sorted in order specified by param isReverse.

Value parameters

isReverse

whether sorted in descending order or not

start

the start index of the range

stop

the stop index of the range

Attributes

def remove(element: Elem*): Result[This]

Removes the specified members from the sorted set stored at key. Non existing members are ignored. An error is returned when key exists and does not hold a sorted set.

Removes the specified members from the sorted set stored at key. Non existing members are ignored. An error is returned when key exists and does not hold a sorted set.

Value parameters

element

elements to be removed

Attributes

Returns

the sorted set for chaining calls

Note

Time complexity: O(M*log(N)) with N being the number of elements in the sorted set and M the number of elements to be removed.

Inherited methods

def isEmpty: Result[Boolean]

Attributes

Inherited from:
RedisCollection (hidden)
def nonEmpty: Result[Boolean]

Attributes

Inherited from:
RedisCollection (hidden)
def size: Result[Long]

Returns the length of the collection stored at key. If key does not exist, it is interpreted as an empty collection and 0 is returned. An error is returned when the value stored at key is not a proper collection.

Returns the length of the collection stored at key. If key does not exist, it is interpreted as an empty collection and 0 is returned. An error is returned when the value stored at key is not a proper collection.

Time complexity: O(1)

Attributes

Returns

size of the list

Inherited from:
RedisCollection (hidden)