Sorted sets

Sets whose members each carry a score, kept in score order: ranges by score, rank or name, ranks, and set algebra.

35 commands in KiviDB 1.1.2. Every command.

  • BZMPOP: ZMPOP that waits until one of the sorted sets has a member, or timeout seconds have passed.
  • BZPOPMAX: BZPOPMIN for the highest score.
  • BZPOPMIN: ZPOPMIN of one member from the first non-empty sorted set of those given.
  • ZADD: Adds members with scores to the sorted set at key, or updates the scores of members already in it.
  • ZCARD: Returns the number of members of the sorted set at key.
  • ZCOUNT: Counts the members of the sorted set at key with a score between min and max.
  • ZDIFF: Returns the members of the first sorted set that are in none of the others, with their scores if WITHSCORES is given.
  • ZDIFFSTORE: Stores what ZDIFF would return at destination, replacing whatever was there.
  • ZINCRBY: Adds increment to the score of member in the sorted set at key.
  • ZINTER: Returns the members in every one of the given sorted sets, with scores combined.
  • ZINTERCARD: Returns how many members the intersection of the given sorted sets has, without returning them.
  • ZINTERSTORE: Stores what ZINTER would return at destination, replacing whatever was there.
  • ZLEXCOUNT: Counts the members of the sorted set at key between min and max in lexicographical order.
  • ZMPOP: Pops members from the first of the given sorted sets that is not empty: the lowest (MIN) or highest (MAX) scores, one or COUNT count of them.
  • ZMSCORE: Returns the scores of several members of the sorted set at key.
  • ZPOPMAX: Removes and returns the members with the highest scores in the sorted set at key: one, or count.
  • ZPOPMIN: Removes and returns the members with the lowest scores in the sorted set at key: one, or count.
  • ZRANDMEMBER: Returns members of the sorted set at key, picked at random, without removing them.
  • ZRANGE: Returns members of the sorted set at key in a range.
  • ZRANGEBYLEX: Returns members of the sorted set at key between min and max in lexicographical order, for sets whose members all have the same score.
  • ZRANGEBYSCORE: Returns members of the sorted set at key with scores from min to max, lowest first.
  • ZRANGESTORE: Stores the members ZRANGE would return, with their scores, at dst, replacing whatever was there.
  • ZRANK: Returns the rank of member in the sorted set at key: its position from the lowest score, starting at 0.
  • ZREM: Removes members from the sorted set at key.
  • ZREMRANGEBYLEX: Removes the members of the sorted set at key between min and max in lexicographical order, with bounds as ZRANGEBYLEX takes them.
  • ZREMRANGEBYRANK: Removes the members of the sorted set at key with ranks from start to stop, both included.
  • ZREMRANGEBYSCORE: Removes the members of the sorted set at key with scores from min to max.
  • ZREVRANGE: Returns members of the sorted set at key by rank, highest score first.
  • ZREVRANGEBYLEX: ZRANGEBYLEX in reverse order; max comes first.
  • ZREVRANGEBYSCORE: Returns members of the sorted set at key with scores from max down to min.
  • ZREVRANK: Returns the rank of member from the highest score, starting at 0.
  • ZSCAN: Goes through the members of the sorted set at key a page at a time, as SCAN goes through keys.
  • ZSCORE: Returns the score of member in the sorted set at key.
  • ZUNION: Returns the members in any of the given sorted sets, with scores combined.
  • ZUNIONSTORE: Stores what ZUNION would return at destination, replacing whatever was there.