scredis.commands

SortedSetsCommands

trait SortedSetsCommands extends AnyRef

This trait implements sorted sets commands.

Self Type
SortedSetsCommands with Protocol
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SortedSetsCommands
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. val Aggregate: String

    Attributes
    protected
  5. val Limit: String

    Attributes
    protected
  6. val Weights: String

    Attributes
    protected
  7. val WithScores: String

    Attributes
    protected
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  14. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  20. def toString(): String

    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. def zAdd(key: String, memberScorePair: (Any, Double), memberScorePairs: (Any, Double)*)(implicit opts: CommandOptions = DefaultCommandOptions): Long

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

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

    key

    sorted set key

    memberScorePair

    member-score pair to be added

    memberScorePairs

    additional member-score pairs to be added (adding several members at once only works with Redis >= 2.4)

    returns

    the number of elements added to the sorted sets, not including elements already existing for which the score was updated

    Since

    1.2.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if key contains a value that is not a sorted set

    Note

    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.

  25. def zAddFromMap(key: String, memberScoreMap: Map[Any, Double])(implicit opts: CommandOptions = DefaultCommandOptions): Long

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

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

    key

    sorted set key

    memberScoreMap

    member-score pairs to be added (adding several members at once only works with Redis >= 2.4)

    returns

    the number of elements added to the sorted sets, not including elements already existing for which the score was updated

    Since

    1.2.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if memberScoreMap is empty or key contains a value that is not a sorted set

    Note

    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.

  26. def zCard(key: String)(implicit opts: CommandOptions = DefaultCommandOptions): Long

    Returns the number of members in a sorted set.

    Returns the number of members in a sorted set.

    key

    sorted set key

    returns

    the cardinality (number of elements) of the sorted set, or 0 if key does not exist

    Since

    1.2.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if key contains a value that is not a sorted set

  27. def zCount(key: String, min: Score, max: Score)(implicit opts: CommandOptions = DefaultCommandOptions): Long

    Returns the number of elements of a sorted set belonging to a given score range.

    Returns the number of elements of a sorted set belonging to a given score range.

    key

    sorted set key

    min

    score lower bound

    max

    score upper bound

    returns

    the number of elements in the specified score range

    Since

    2.0.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if key contains a value that is not a sorted set

  28. def zIncrBy(key: String, member: Any, count: Double)(implicit opts: CommandOptions = DefaultCommandOptions): Double

    Increments the score of a member in a sorted set.

    Increments the score of a member in a sorted set.

    key

    sorted set key

    member

    member whose score needs to be incremented

    count

    the increment

    returns

    the new score of member

    Since

    1.2.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if key contains a value that is not a sorted set

  29. def zInterStore(destKey: String, aggregate: Aggregate = Sum)(key: String, keys: String*)(implicit opts: CommandOptions = DefaultCommandOptions): Long

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

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

    destKey

    sorted set key

    aggregate

    aggregation function (default is Sum)

    key

    key of first sorted set

    keys

    additional keys of sorted sets

    returns

    the number of elements in the resulting sorted set stored at destKey

    Since

    2.0.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if key contains a value that is not a sorted set

  30. def zInterStoreWeighted(destKey: String, aggregate: Aggregate = Sum)(keyWeightPair: (String, Int), keyWeightPairs: (String, Int)*)(implicit opts: CommandOptions = DefaultCommandOptions): Long

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

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

    destKey

    sorted set key

    aggregate

    aggregation function (default is Sum)

    keyWeightPair

    first sorted set key to weight pair

    keyWeightPairs

    additional sorted set key to weight pairs

    returns

    the number of elements in the resulting sorted set stored at destKey

    Since

    2.0.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if key contains a value that is not a sorted set

  31. def zRange[A](key: String, start: Long = 0, end: Long = 1)(implicit opts: CommandOptions = DefaultCommandOptions, parser: Parser[A] = StringParser): LinkedHashSet[A]

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

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

    key

    sorted set key

    start

    start offset (inclusive)

    end

    end offset (inclusive)

    returns

    the set of ascendingly ordered elements in the specified range, or the empty set if key does not exist

    Since

    1.2.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if key contains a value that is not a sorted set

    Note

    Both start and stop are zero-based indexes, where 0 is the first element, 1 is the next element and so on. They can also be negative numbers indicating offsets from the end of the sorted set, with -1 being the last element of the sorted set, -2 the penultimate element and so on. Out of range indexes will not produce an error. If start is larger than the largest index in the sorted set, or start > end, an empty list is returned. If end is larger than the end of the sorted set Redis will treat it like it is the last element of the sorted set. The indexes are inclusive.

  32. def zRangeByScore[A](key: String, min: Score, max: Score, limit: Option[(Long, Long)] = None)(implicit opts: CommandOptions = DefaultCommandOptions, parser: Parser[A] = StringParser): LinkedHashSet[A]

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

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

    key

    sorted set key

    min

    score lower bound

    max

    score upper bound

    limit

    optional offset and count pair used to limit the number of matching elements

    returns

    the set of ascendingly ordered elements in the specified score range, or the empty set if key does not exist

    Since

    2.2.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if key contains a value that is not a sorted set

    Note

    The elements having the same score are returned in lexicographical order (this follows from a property of the sorted set implementation in Redis and does not involve further computation).

  33. def zRangeByScoreWithScores[A](key: String, min: Score, max: Score, limit: Option[(Long, Long)] = None)(implicit opts: CommandOptions = DefaultCommandOptions, parser: Parser[A] = StringParser): LinkedHashSet[(A, Double)]

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

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

    key

    sorted set key

    min

    score lower bound

    max

    score upper bound

    limit

    optional offset and count pair used to limit the number of matching elements

    returns

    the set of ascendingly ordered element-score pairs in the specified score range, or the empty set if key does not exist

    Since

    2.0.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if key contains a value that is not a sorted set

    Note

    The elements having the same score are returned in lexicographical order (this follows from a property of the sorted set implementation in Redis and does not involve further computation).

  34. def zRangeWithScores[A](key: String, start: Long = 0, end: Long = 1)(implicit opts: CommandOptions = DefaultCommandOptions, parser: Parser[A] = StringParser): LinkedHashSet[(A, Double)]

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

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

    key

    sorted set key

    start

    start offset (inclusive)

    end

    end offset (inclusive)

    returns

    the set of ascendingly ordered elements-score pairs in the specified range, or the empty set if key does not exist

    Since

    1.2.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if key contains a value that is not a sorted set

    Note

    Both start and stop are zero-based indexes, where 0 is the first element, 1 is the next element and so on. They can also be negative numbers indicating offsets from the end of the sorted set, with -1 being the last element of the sorted set, -2 the penultimate element and so on. Out of range indexes will not produce an error. If start is larger than the largest index in the sorted set, or start > end, an empty list is returned. If end is larger than the end of the sorted set Redis will treat it like it is the last element of the sorted set. The indexes are inclusive.

  35. def zRank(key: String, member: Any)(implicit opts: CommandOptions = DefaultCommandOptions): Option[Long]

    Determines the index of a member in a sorted set.

    Determines the index of a member in a sorted set.

    key

    sorted set key

    member

    the value

    returns

    the rank or index of the member, or None if the member is not in the set or the key does not exist

    Since

    2.0.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if key contains a value that is not a sorted set

  36. def zRem(key: String, member: Any, members: Any*)(implicit opts: CommandOptions = DefaultCommandOptions): Long

    Removes one or more members from a sorted set.

    Removes one or more members from a sorted set.

    key

    sorted set key

    member

    the value to be removed

    members

    additional values to be removed (only works with Redis >= 2.4)

    returns

    the number of members removed from the sorted set, not including non existing members

    Since

    2.0.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if key contains a value that is not a sorted set

    Note

    Redis versions older than 2.4 can only remove one value per call.

  37. def zRemRangeByRank(key: String, start: Long, end: Long)(implicit opts: CommandOptions = DefaultCommandOptions): Long

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

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

    key

    sorted set key

    start

    the start offset or index (inclusive)

    end

    the end offset or index (inclusive)

    returns

    the number of members removed

    Since

    2.0.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if key contains a value that is not a sorted set

    Note

    Both start and stop are zero-based inclusive indexes with 0 being the element with the lowest score. These indexes can be negative numbers, where they indicate offsets starting at the element with the highest score. For example: -1 is the element with the highest score, -2 the element with the second highest score and so forth.

  38. def zRemRangeByScore(key: String, min: Score, max: Score)(implicit opts: CommandOptions = DefaultCommandOptions): Long

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

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

    key

    sorted set key

    min

    score lower bound

    max

    score upper bound

    returns

    the number of members removed

    Since

    1.2.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if key contains a value that is not a sorted set

    Note

    Since version 2.1.6, min and max can be exclusive, following the syntax of ZRANGEBYSCORE.

  39. def zRevRange[A](key: String, start: Long = 0, end: Long = 1)(implicit opts: CommandOptions = DefaultCommandOptions, parser: Parser[A] = StringParser): LinkedHashSet[A]

    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 index, with scores ordered from high to low.

    key

    sorted set key

    start

    start offset (inclusive)

    end

    end offset (inclusive)

    returns

    the set of descendingly ordered elements in the specified range, or the empty set if key does not exist

    Since

    1.2.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if key contains a value that is not a sorted set

    Note

    Apart from the reversed ordering, ZREVRANGE is similar to ZRANGE.

  40. def zRevRangeByScore[A](key: String, max: Score, min: Score, limit: Option[(Long, Long)] = None)(implicit opts: CommandOptions = DefaultCommandOptions, parser: Parser[A] = StringParser): LinkedHashSet[A]

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

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

    key

    sorted set key

    max

    score upper bound

    min

    score lower bound

    limit

    optional offset and count pair used to limit the number of matching elements

    returns

    the set of descendingly ordered elements in the specified score range, or the empty set if key does not exist

    Since

    2.2.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if key contains a value that is not a sorted set

    Note

    Apart from the reversed ordering, ZREVRANGEBYSCORE is similar to ZRANGEBYSCORE.

  41. def zRevRangeByScoreWithScores[A](key: String, max: Score, min: Score, limit: Option[(Long, Long)] = None)(implicit opts: CommandOptions = DefaultCommandOptions, parser: Parser[A] = StringParser): LinkedHashSet[(A, Double)]

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

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

    key

    sorted set key

    max

    score upper bound

    min

    score lower bound

    limit

    optional offset and count pair used to limit the number of matching elements

    returns

    the set of descendingly ordered elements in the specified score range, or the empty set if key does not exist

    Since

    2.0.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if key contains a value that is not a sorted set

    Note

    Apart from the reversed ordering, ZREVRANGEBYSCORE is similar to ZRANGEBYSCORE.

  42. def zRevRangeWithScores[A](key: String, start: Long = 0, end: Long = 1)(implicit opts: CommandOptions = DefaultCommandOptions, parser: Parser[A] = StringParser): LinkedHashSet[(A, Double)]

    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 index, with scores ordered from high to low.

    key

    sorted set key

    start

    start offset (inclusive)

    end

    end offset (inclusive)

    returns

    the set of descendingly ordered elements-score pairs in the specified range, or the empty set if key does not exist

    Since

    1.2.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if key contains a value that is not a sorted set

    Note

    Apart from the reversed ordering, ZREVRANGE is similar to ZRANGE.

  43. def zRevRank(key: String, member: Any)(implicit opts: CommandOptions = DefaultCommandOptions): Option[Long]

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

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

    key

    sorted set key

    member

    the value

    returns

    the rank or index of the member, or None if the member is not in the set or the key does not exist

    Since

    2.0.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if key contains a value that is not a sorted set

  44. def zScan[A](key: String)(cursor: Long, countOpt: Option[Int] = None, matchOpt: Option[String] = None)(implicit opts: CommandOptions = DefaultCommandOptions, parser: Parser[A] = StringParser): (Long, LinkedHashSet[(A, Double)])

    Incrementally iterates the elements (value-score pairs) of a sorted set.

    Incrementally iterates the elements (value-score pairs) of a sorted set.

    cursor

    the offset

    countOpt

    when defined, provides a hint of how many elements should be returned

    matchOpt

    when defined, the command only returns elements matching the pattern

    returns

    a pair containing the next cursor as its first element and the sorted set of elements (value-score pairs) as its second element

    Since

    2.8.0

  45. def zScore(key: String, member: Any)(implicit opts: CommandOptions = DefaultCommandOptions): Option[Double]

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

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

    key

    sorted set key

    member

    the value

    returns

    the score of member, or None if the latter is not in the sorted set or the key does not exist

    Since

    1.2.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if key contains a value that is not a sorted set

  46. def zUnionStore(destKey: String, aggregate: Aggregate = Sum)(key: String, keys: String*)(implicit opts: CommandOptions = DefaultCommandOptions): Long

    Computes the union of multiple sorted sets and stores the resulting sorted set in a new key.

    Computes the union of multiple sorted sets and stores the resulting sorted set in a new key.

    destKey

    sorted set key

    aggregate

    aggregation function (default is Sum)

    key

    key of first sorted set

    keys

    additional keys of sorted sets

    returns

    the number of elements in the resulting sorted set stored at destKey

    Since

    2.0.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if key contains a value that is not a sorted set

  47. def zUnionStoreWeighted(destKey: String, aggregate: Aggregate = Sum)(keyWeightPair: (String, Int), keyWeightPairs: (String, Int)*)(implicit opts: CommandOptions = DefaultCommandOptions): Long

    Computes the union of multiple sorted sets and stores the resulting sorted set in a new key.

    Computes the union of multiple sorted sets and stores the resulting sorted set in a new key.

    destKey

    sorted set key

    aggregate

    aggregation function (default is Sum)

    keyWeightPair

    first sorted set key to weight pair

    keyWeightPairs

    additional sorted set key to weight pairs

    returns

    the number of elements in the resulting sorted set stored at destKey

    Since

    2.0.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if key contains a value that is not a sorted set

Inherited from AnyRef

Inherited from Any

Ungrouped