The Redis HRANDFIELD
command allows us to get a random field from a given key.
The command accepts several arguments that allows us to specify the number of random fields returned, whether to include the same field multiple times, and whether or not to include the values with each field returned.
The HRANDFIELD
command was introduced in Redis 6.2.0.