You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
randomEntries(H key, long count) should return the count equivalent entries in case of a negative (absolute value of count) or a positive count value.
Actual behavior
randomEntries(H key, long count) currently returns a Map<HK, HV> which does not account for the duplicates that can be returned(https://redis.io/commands/hrandfield/) when a negative count is given. This results in an inaccurate number (less than the count) of random entries being returned when there is a negative count.
Steps to reproduce:
Create a Hash Set with size 5
Call random entries(H key, long count); with a count of -3.
Assert for the size of the result.
The text was updated successfully, but these errors were encountered:
This limitation is a deliberate design choice of the original ticket as the API would have required two methods or an inconvenient return type that would not allow map lookups. If you want to obtain non-distinct map entries, please use the hRandFieldWithValues(…) method on RedisConnection directly.
Expected behavior
randomEntries(H key, long count)
should return the count equivalent entries in case of a negative (absolute value of count) or a positive count value.Actual behavior
randomEntries(H key, long count)
currently returns a Map<HK, HV> which does not account for the duplicates that can be returned(https://redis.io/commands/hrandfield/) when a negative count is given. This results in an inaccurate number (less than the count) of random entries being returned when there is a negative count.Steps to reproduce:
Create a Hash Set with size 5
Call random entries(H key, long count); with a count of -3.
Assert for the size of the result.
The text was updated successfully, but these errors were encountered: