In Redis, the ZRANK command returns the rank of the specified element of a sorted set.
The scores are ordered from low to high. If we want them in the opposite order, we can use the ZREVRANK command.
In Redis, the ZRANDMEMBER command enables us to get one or more random elements from a sorted set.
We can specify whether or not to return only distinct elements or to allow duplicates. We can also specify whether or not to include the scores of each element in the result.
In Redis, the ZRANGE command returns the specified range of elements in the sorted set stored at the specified key.
It can perform different types of range queries: by index (rank), by the score, or by lexicographical order.
In Redis, the ZADD command is used to add one or more members to a sorted set, or to update the score for members that already exist in the sorted set.
It returns the number of elements added to the sorted set, or the number of elements updated if the CH argument is used.
In PostgreSQL, the DATE_BIN() function enables us to “bin” a timestamp into a given interval aligned with a specific origin. In other words, we can use this function to map (or force) a timestamp to the nearest specified interval.
This can be handy when we want to truncate a timestamp to a given interval, for example a 10 minute interval. We can specify the interval (e.g. 10 minutes, 15 minutes, 30 minutes, etc), and we can specify the starting point for the interval. Therefore, we can have the interval starting at any odd time we want (it doesn’t need to start on the hour or anything like that).
The Redis HINCRBYFLOAT command increments the field in the hash at the specified key by a floating point number. We specify how much we want the field to increment by when we call the command.
The Redis HINCRBY command increments the number that’s stored at the specified field in the hash at the specified key. We specify how much we want the field to increment by when we call the command.
The Redis HVALS command returns all values in the hash stored at the specified key.
The Redis HLEN command returns the number of fields in the hash stored at the specified key.