There is redis hash with 100-200 fields. If I need take 2 or 3 values, what method is best way?
First way is call hgetall, but i got many useless data.
Second way is call hget key1, hget key2 and hgetkey3 - but is three different call.
Do not use HGETALL
unless you need the entire Hash's contents (beware, however, of its O(N) time complexity).
You can use the HMGET
command to retrieve only those fields in the Hash that are of interest to you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With