Usage
Returns the values associated with the specified fields in the hash stored atkey. Returns an object with the requested fields.
Parameters
The key of the hash
One or more field names to retrieve from the hash
Response
An object containing the requested fields and their values. Fields that do not exist will have
null values.Returns null if the hash does not exist or all requested fields are empty.The return type is a record where keys are the requested field names and values are the stored values (or null if the field doesn’t exist).Examples
Get multiple fields
Handle missing fields
Working with typed data
Fetch subset of large hash
Non-existent hash
All fields are null
Efficient partial reads
Build partial objects
Batch read from multiple hashes
Check field values efficiently
Notes
- More efficient than multiple
HGETcalls when you need multiple fields - More efficient than
HGETALLwhen you only need a subset of fields - Returns
nullfor the entire result if the hash doesn’t exist or all fields are null - Individual fields that don’t exist have
nullvalues in the returned object - Values are automatically parsed from JSON when possible