Redis › Hashes in Redis
How do you check if a specific field exists within a hash, and how do you delete just one field without affecting the rest of the hash?
IntermediateAnswer
You use HEXISTS to check whether a specific field is present in a hash, returning a simple true or false style result, and HDEL to remove one or more specific fields from a hash, leaving the remaining fields completely untouched.
HEXISTS user:100 phoneNumber
HDEL user:100 temporaryFlagReal-world example A user profile system checks whether an optional phone number field exists before displaying it, and removes a temporary flag field from a user's hash once it is no longer needed, without affecting any other stored profile data.