Redis SINTERSTORE Command Explained

In Redis, the SINTERSTORE command is the same as the SINTER command, except that it stores the result in the specified key, instead of returning it.

It stores the members of the set resulting from the intersection of all the given sets.

If the destination key already exists, it’s overwritten. If it doesn’t exist, it’s created and the resulting members are added to it.

Continue reading

How to Return the Expiry Time as a Unix Timestamp in Redis

In Redis, we have several options for returning the expiry time of a key. One option from Redis 7.0.0 and above is to return it as a Unix timestamp.

When returning the expiry as a Unix timestamp, we can have it returned in seconds or milliseconds. To return it in seconds, we can use the EXPIRETIME command. To return it in milliseconds, we can use the PEXPIRETIME command.

Continue reading