Usage
Returns iffield is an existing field in the hash stored at key.
Parameters
The key of the hash
The field name to check for existence
Response
Returns
1 if the hash contains the field, 0 if the hash does not contain the field or the key does not exist.Examples
Check if a field exists
Conditional field operations
Validate required fields
Check before deletion
Feature flag checking
Non-existent key
Notes
- Returns
1(nottrue) when the field exists - Returns
0(notfalse) when the field doesn’t exist - Useful for conditional logic before setting or deleting fields
- More efficient than getting the value when you only need to check existence