By default, Redis’s HRANDFIELD
command returns distinct fields. In other words, it won’t return the same field multiple times – each field that’s returned by the command will only be returned once.
However, we can override this behaviour by using an negative count value for the count
argument.
When we pass a negative count
argument, the HRANDFIELD
command allows non-distinct fields to be returned.