pub trait SortedSetCommands: CommandSend {
Show 27 methods fn zadd<K>(&self, key: K) -> ZAdd<'_, Self>
   where
        K: Into<BulkString>
, { ... } fn zcard<K>(
        &self,
        key: K
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + '_>>
   where
        K: Into<BulkString>
, { ... } fn zcount<K, T, U>(
        &self,
        key: K,
        min: T,
        max: U
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + '_>>
   where
        K: Into<BulkString>,
        T: Into<BulkString>,
        U: Into<BulkString>
, { ... } fn zdiff<K, C>(&self, keys: C) -> ZDiff<'_, Self>
   where
        K: Into<BulkString>,
        C: SingleArgOrCollection<K>
, { ... } fn zdiffstore<D, K, C>(
        &self,
        destination: D,
        keys: C
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + '_>>
   where
        D: Into<BulkString>,
        K: Into<BulkString>,
        C: SingleArgOrCollection<K>
, { ... } fn zincrby<K, M>(
        &self,
        key: K,
        increment: f64,
        member: M
    ) -> Pin<Box<dyn Future<Output = Result<f64>> + '_>>
   where
        K: Into<BulkString>,
        M: Into<BulkString>
, { ... } fn zinter<K, C>(&self, keys: C) -> ZInterUnion<'_, Self>
   where
        K: Into<BulkString>,
        C: SingleArgOrCollection<K>
, { ... } fn zintercard<K, C>(
        &self,
        keys: C,
        limit: usize
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + '_>>
   where
        K: Into<BulkString>,
        C: SingleArgOrCollection<K>
, { ... } fn zinterstore<D, K, C>(
        &self,
        destination: D,
        keys: C
    ) -> ZInterUnionStore<'_, Self>
   where
        D: Into<BulkString>,
        K: Into<BulkString>,
        C: SingleArgOrCollection<K>
, { ... } fn zlexcount<K, M1, M2>(
        &self,
        key: K,
        min: M1,
        max: M2
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + '_>>
   where
        K: Into<BulkString>,
        M1: Into<BulkString>,
        M2: Into<BulkString>
, { ... } fn zmpop<K, C, E>(
        &self,
        keys: C,
        where_: ZWhere,
        count: usize
    ) -> Pin<Box<dyn Future<Output = Result<(String, Vec<(E, f64)>)>> + '_>>
   where
        K: Into<BulkString>,
        C: SingleArgOrCollection<K>,
        E: FromValue + Default
, { ... } fn zmscore<K, M, C>(
        &self,
        key: K,
        members: C
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<f64>>>> + '_>>
   where
        K: Into<BulkString>,
        M: Into<BulkString>,
        C: SingleArgOrCollection<M>
, { ... } fn zpopmax<K, M>(
        &self,
        key: K,
        count: usize
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(M, f64)>>> + '_>>
   where
        K: Into<BulkString>,
        M: FromValue
, { ... } fn zpopmin<K, M>(
        &self,
        key: K,
        count: usize
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(M, f64)>>> + '_>>
   where
        K: Into<BulkString>,
        M: FromValue
, { ... } fn zrandmember<K>(&self, key: K) -> ZRandMember<'_, Self>
   where
        K: Into<BulkString>
, { ... } fn zrange<K, S>(&self, key: K, start: S, stop: S) -> ZRange<'_, Self>
   where
        K: Into<BulkString>,
        S: Into<BulkString>
, { ... } fn zrangestore<D, S, T>(
        &self,
        dst: D,
        src: S,
        start: T,
        stop: T
    ) -> ZRangeStore<'_, Self>
   where
        D: Into<BulkString>,
        S: Into<BulkString>,
        T: Into<BulkString>
, { ... } fn zrank<K, M>(
        &self,
        key: K,
        member: M
    ) -> Pin<Box<dyn Future<Output = Result<Option<usize>>> + '_>>
   where
        K: Into<BulkString>,
        M: Into<BulkString>
, { ... } fn zrem<K, M, C>(
        &self,
        key: K,
        members: C
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + '_>>
   where
        K: Into<BulkString>,
        M: Into<BulkString>,
        C: SingleArgOrCollection<M>
, { ... } fn zremrangebylex<K, S>(
        &self,
        key: K,
        start: S,
        stop: S
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + '_>>
   where
        K: Into<BulkString>,
        S: Into<BulkString>
, { ... } fn zremrangebyrank<K>(
        &self,
        key: K,
        start: isize,
        stop: isize
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + '_>>
   where
        K: Into<BulkString>
, { ... } fn zremrangebyscore<K, S>(
        &self,
        key: K,
        start: S,
        stop: S
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + '_>>
   where
        K: Into<BulkString>,
        S: Into<BulkString>
, { ... } fn zrevrank<K, M>(
        &self,
        key: K,
        member: M
    ) -> Pin<Box<dyn Future<Output = Result<Option<usize>>> + '_>>
   where
        K: Into<BulkString>,
        M: Into<BulkString>
, { ... } fn zscan<K>(&self, key: K, cursor: usize) -> ZScan<'_, Self>
   where
        K: Into<BulkString>
, { ... } fn zscore<K, M>(
        &self,
        key: K,
        member: M
    ) -> Pin<Box<dyn Future<Output = Result<Option<f64>>> + '_>>
   where
        K: Into<BulkString>,
        M: Into<BulkString>
, { ... } fn zunion<K, C>(&self, keys: C) -> ZInterUnion<'_, Self>
   where
        K: Into<BulkString>,
        C: SingleArgOrCollection<K>
, { ... } fn zunionstore<D, K, C>(
        &self,
        destination: D,
        keys: C
    ) -> ZInterUnionStore<'_, Self>
   where
        D: Into<BulkString>,
        K: Into<BulkString>,
        C: SingleArgOrCollection<K>
, { ... }
}
Expand description

A group of Redis commands related to Sorted Sets

See Also

Redis Sorted Set Commands

Provided Methods

Adds all the specified members with the specified scores to the sorted set stored at key.

See Also

https://redis.io/commands/zadd/

Returns the sorted set cardinality (number of elements) of the sorted set stored at key.

Return

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

See Also

https://redis.io/commands/zcard/

Returns the number of elements in the sorted set at key with a score between min and max.

Return

The number of elements in the specified score range.

See Also

https://redis.io/commands/zcount/

This command is similar to zdiffstore, but instead of storing the resulting sorted set, it is returned to the client.

Return

The number of elements in the specified score range.

See Also

https://redis.io/commands/zdiff/

Computes the difference between the first and all successive input sorted sets and stores the result in destination.

Return

The number of elements in the resulting sorted set at destination.

See Also

https://redis.io/commands/zdiffstore/

Increments the score of member in the sorted set stored at key by increment.

Return

the new score of member

See Also

https://redis.io/commands/zincrby/

This command is similar to zinterstore, but instead of storing the resulting sorted set, it is returned to the client.

See Also

https://redis.io/commands/zinter/

This command is similar to zinter, but instead of returning the result set, it returns just the cardinality of the result.

the algorithm will exit and yield limit as the cardinality. 0 means unlimited

See Also

https://redis.io/commands/zintercard/

Computes the intersection of numkeys sorted sets given by the specified keys, and stores the result in destination.

Return

The number of elements in the resulting sorted set at destination.

See Also

https://redis.io/commands/zinterstore/

When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns the number of elements in the sorted set at key with a value between min and max.

Return

the number of elements in the specified score range.

See Also

https://redis.io/commands/zlexcount/

Pops one or more elements, that are member-score pairs, from the first non-empty sorted set in the provided list of key names.

Return

the number of elements in the specified score range.

See Also

https://redis.io/commands/zmpop/

Returns the scores associated with the specified members in the sorted set stored at key.

For every member that does not exist in the sorted set, a nil value is returned.

Return

The list of scores or nil associated with the specified member value

See Also

https://redis.io/commands/zmscore/

Removes and returns up to count members with the highest scores in the sorted set stored at key.

Return

The list of popped elements and scores.

See Also

https://redis.io/commands/zpopmax/

Removes and returns up to count members with the lowest scores in the sorted set stored at key.

Return

The list of popped elements and scores.

See Also

https://redis.io/commands/zpopmin/

Removes and returns up to count members with the lowest scores in the sorted set stored at key.

Return

The list of popped elements and scores.

See Also

https://redis.io/commands/zrandmember/

Returns the specified range of elements in the sorted set stored at key.

See Also

https://redis.io/commands/zrange/

This command is like zrange, but stores the result in the dst destination key.

See Also

https://redis.io/commands/zrangestore/

Returns the rank of member in the sorted set stored at key, with the scores ordered from low to high.

Return
  • If member exists in the sorted set, the rank of member.
  • If member does not exist in the sorted set or key does not exist, None.
See Also

https://redis.io/commands/zrank/

Removes the specified members from the sorted set stored at key.

Return

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

See Also

https://redis.io/commands/zrem/

When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command removes all elements in the sorted set stored at key between the lexicographical range specified by min and max.

Return

the number of elements removed.

See Also

https://redis.io/commands/zremrangebylex/

Removes all elements in the sorted set stored at key with rank between start and stop.

Return

the number of elements removed.

See Also

https://redis.io/commands/zremrangebyrank/

Removes all elements in the sorted set stored at key with a score between min and max (inclusive).

Return

the number of elements removed.

See Also

https://redis.io/commands/zremrangebyscore/

Returns the rank of member in the sorted set stored at key, with the scores ordered from high to low.

Return
  • If member exists in the sorted set, the rank of member.
  • If member does not exist in the sorted set or key does not exist, None.
See Also

https://redis.io/commands/zrevrank/

Iterates elements of Sorted Set types and their associated scores.

Return

The list of members and their associated scores.

See Also

https://redis.io/commands/zscan/

Returns the score of member in the sorted set at key.

Return

The score of member or nil if keydoes not exist

See Also

https://redis.io/commands/zscore/

This command is similar to zunionstore, but instead of storing the resulting sorted set, it is returned to the client.

See Also

https://redis.io/commands/zunion/

Computes the union of numkeys sorted sets given by the specified keys, and stores the result in destination.

Return

The number of elements in the resulting sorted set at destination.

See Also

https://redis.io/commands/zunionstore/

Implementors