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.
Continue readingIn 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.
Continue readingIn 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, we can use the RETURNING
clause to return data that was modified during an UPDATE
, INSERT
, or DELETE
operation. This allows us to see the data that was modified without having to perform a separate query to retrieve that data.
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).
Continue readingThe 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.
The Redis HGETALL
command returns all fields and values from the hash at the specified key.
The Redis HMGET
command allows us to get multiple values from a hash. It returns the value/s associated with the specified field/s in the hash at the specified key.