Trait

scredis.commands

SortedSetCommands

Related Doc: package commands

Permalink

trait SortedSetCommands extends AnyRef

This trait implements sorted set commands.

Self Type
SortedSetCommands with Connection with NonBlockingConnection
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SortedSetCommands
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  9. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  10. final def isInstanceOf[T0]: Boolean

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

    Permalink
    Definition Classes
    AnyRef
  12. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  13. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  14. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  15. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  16. final def wait(arg0: Long, arg1: Int): Unit

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. def zAdd[W](key: String, members: Map[W, Score])(implicit arg0: Writer[W]): Future[Long]

    Permalink

    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

    members

    member-score pairs to be added

    returns

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

    Since

    2.4

    Exceptions thrown

    [[scredis.exceptions.RedisErrorResponseException]] 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.

  20. def zAdd[W](key: String, member: W, score: Score)(implicit arg0: Writer[W]): Future[Boolean]

    Permalink

    Adds a member to a sorted set, or update its score if it already exists.

    Adds a member to a sorted set, or update its score if it already exists.

    key

    sorted set key

    member

    member to add

    score

    score of the member to add

    returns

    true if the member was added, or false if the member already exists

    Since

    1.2.0

    Exceptions thrown

    [[scredis.exceptions.RedisErrorResponseException]] 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.

  21. def zCard(key: String): Future[Long]

    Permalink

    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.RedisErrorResponseException]] if key contains a value that is not a sorted set

  22. def zCount(key: String, min: ScoreLimit, max: ScoreLimit): Future[Long]

    Permalink

    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.RedisErrorResponseException]] if key contains a value that is not a sorted set

  23. def zIncrBy[W](key: String, member: W, increment: Double)(implicit arg0: Writer[W]): Future[Double]

    Permalink

    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

    increment

    the increment

    returns

    the new score of member

    Since

    1.2.0

    Exceptions thrown

    [[scredis.exceptions.RedisErrorResponseException]] if key contains a value that is not a sorted set

  24. def zInterStore(destKey: String, keys: Seq[String], aggregate: Aggregate = scredis.Aggregate.Sum): Future[Long]

    Permalink

    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

    keys

    keys of sorted sets to intersect

    aggregate

    aggregation function (default is Sum)

    returns

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

    Since

    2.0.0

    Exceptions thrown

    [[scredis.exceptions.RedisErrorResponseException]] if key contains a value that is not a sorted set

  25. def zInterStoreWeighted(destKey: String, keysWeightPairs: Map[String, Double], aggregate: Aggregate = scredis.Aggregate.Sum): Future[Long]

    Permalink

    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

    keysWeightPairs

    key to weight pairs

    aggregate

    aggregation function (default is Sum)

    returns

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

    Since

    2.0.0

    Exceptions thrown

    [[scredis.exceptions.RedisErrorResponseException]] if key contains a value that is not a sorted set

  26. def zLexCount(key: String, min: LexicalScoreLimit, max: LexicalScoreLimit): Future[Long]

    Permalink

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

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

    key

    sorted set key

    min

    lexical score lower bound

    max

    lexical score upper bound

    returns

    the number of elements in the specified lexical score range

    Since

    2.8.9

    Exceptions thrown

    [[scredis.exceptions.RedisErrorResponseException]] if key contains a value that is not a sorted set

    Note

    Lexical ordering only applies when all the elements in a sorted set are inserted with the same score

  27. def zRange[R](key: String, start: Long = 0, stop: Long = 1)(implicit arg0: Reader[R]): Future[LinkedHashSet[R]]

    Permalink

    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)

    stop

    stop 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.RedisErrorResponseException]] 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.

  28. def zRangeByLex[R](key: String, min: LexicalScoreLimit, max: LexicalScoreLimit, limitOpt: Option[(Long, Int)] = None)(implicit arg0: Reader[R]): Future[LinkedHashSet[R]]

    Permalink

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

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

    key

    sorted set key

    min

    lexical score lower bound

    max

    lexical score upper bound

    limitOpt

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

    returns

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

    Since

    2.8.9

    Exceptions thrown

    [[scredis.exceptions.RedisErrorResponseException]] if key contains a value that is not a sorted set

    Note

    Lexical ordering only applies when all the elements in a sorted set are inserted with the same score

  29. def zRangeByScore[R](key: String, min: ScoreLimit, max: ScoreLimit, limitOpt: Option[(Long, Int)] = None)(implicit arg0: Reader[R]): Future[LinkedHashSet[R]]

    Permalink

    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

    limitOpt

    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.RedisErrorResponseException]] 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).

  30. def zRangeByScoreWithScores[R](key: String, min: ScoreLimit, max: ScoreLimit, limitOpt: Option[(Long, Int)] = None)(implicit arg0: Reader[R]): Future[LinkedHashSet[(R, Score)]]

    Permalink

    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

    limitOpt

    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.RedisErrorResponseException]] 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).

  31. def zRangeWithScores[R](key: String, start: Long = 0, stop: Long = 1)(implicit arg0: Reader[R]): Future[LinkedHashSet[(R, Score)]]

    Permalink

    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)

    stop

    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.RedisErrorResponseException]] 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 zRank[W](key: String, member: W)(implicit arg0: Writer[W]): Future[Option[Long]]

    Permalink

    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.RedisErrorResponseException]] if key contains a value that is not a sorted set

  33. def zRem[W](key: String, members: W*)(implicit arg0: Writer[W]): Future[Long]

    Permalink

    Removes one or more members from a sorted set.

    Removes one or more members from a sorted set.

    key

    sorted set key

    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.RedisErrorResponseException]] 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.

  34. def zRemRangeByLex(key: String, min: LexicalScoreLimit, max: LexicalScoreLimit): Future[Long]

    Permalink

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

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

    key

    sorted set key

    min

    lexical score lower bound

    max

    lexical score upper bound

    returns

    the number of removed elements

    Since

    2.8.9

    Exceptions thrown

    [[scredis.exceptions.RedisErrorResponseException]] if key contains a value that is not a sorted set

    Note

    Lexical ordering only applies when all the elements in a sorted set are inserted with the same score

  35. def zRemRangeByRank(key: String, start: Long, stop: Long): Future[Long]

    Permalink

    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)

    stop

    the stop offset or index (inclusive)

    returns

    the number of members removed

    Since

    2.0.0

    Exceptions thrown

    [[scredis.exceptions.RedisErrorResponseException]] 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.

  36. def zRemRangeByScore(key: String, min: ScoreLimit, max: ScoreLimit): Future[Long]

    Permalink

    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.RedisErrorResponseException]] 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.

  37. def zRevRange[R](key: String, start: Long = 0, stop: Long = 1)(implicit arg0: Reader[R]): Future[LinkedHashSet[R]]

    Permalink

    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)

    stop

    stop 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.RedisErrorResponseException]] if key contains a value that is not a sorted set

    Note

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

  38. def zRevRangeByScore[R](key: String, max: ScoreLimit, min: ScoreLimit, limitOpt: Option[(Long, Int)] = None)(implicit arg0: Reader[R]): Future[LinkedHashSet[R]]

    Permalink

    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

    limitOpt

    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.RedisErrorResponseException]] if key contains a value that is not a sorted set

    Note

    Apart from the reversed ordering, ZREVRANGEBYSCORE is similar to ZRANGEBYSCORE. The elements having the same score are returned in reverse lexicographical order.

  39. def zRevRangeByScoreWithScores[R](key: String, max: ScoreLimit, min: ScoreLimit, limitOpt: Option[(Long, Int)] = None)(implicit arg0: Reader[R]): Future[LinkedHashSet[(R, Score)]]

    Permalink

    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

    limitOpt

    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.RedisErrorResponseException]] if key contains a value that is not a sorted set

    Note

    Apart from the reversed ordering, ZREVRANGEBYSCORE is similar to ZRANGEBYSCORE. The elements having the same score are returned in reverse lexicographical order.

  40. def zRevRangeWithScores[R](key: String, start: Long = 0, stop: Long = 1)(implicit arg0: Reader[R]): Future[LinkedHashSet[(R, Score)]]

    Permalink

    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)

    stop

    stop 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.RedisErrorResponseException]] if key contains a value that is not a sorted set

    Note

    Apart from the reversed ordering, ZREVRANGE is similar to ZRANGE. The elements having the same score are returned in reverse lexicographical order.

  41. def zRevRank[W](key: String, member: W)(implicit arg0: Writer[W]): Future[Option[Long]]

    Permalink

    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.RedisErrorResponseException]] if key contains a value that is not a sorted set

  42. def zScan[R](key: String, cursor: Long, matchOpt: Option[String] = None, countOpt: Option[Int] = None)(implicit arg0: Reader[R]): Future[(Long, LinkedHashSet[(R, Score)])]

    Permalink

    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

    matchOpt

    when defined, the command only returns elements matching the pattern

    countOpt

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

    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

  43. def zScore[W](key: String, member: W)(implicit arg0: Writer[W]): Future[Option[Score]]

    Permalink

    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.RedisErrorResponseException]] if key contains a value that is not a sorted set

  44. def zUnionStore(destKey: String, keys: Seq[String], aggregate: Aggregate = scredis.Aggregate.Sum): Future[Long]

    Permalink

    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

    keys

    keys of sorted sets

    aggregate

    aggregation function (default is Sum)

    returns

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

    Since

    2.0.0

    Exceptions thrown

    [[scredis.exceptions.RedisErrorResponseException]] if key contains a value that is not a sorted set

  45. def zUnionStoreWeighted(destKey: String, keysWeightPairs: Map[String, Double], aggregate: Aggregate = scredis.Aggregate.Sum): Future[Long]

    Permalink

    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

    keysWeightPairs

    key to weight pairs

    aggregate

    aggregation function (default is Sum)

    returns

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

    Since

    2.0.0

    Exceptions thrown

    [[scredis.exceptions.RedisErrorResponseException]] if key contains a value that is not a sorted set

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped