Programmer Reference : Redis : EsRedisHashCommands
EsRedisHashCommands
Description
Provides an API for the Redis Hash commands. Hashes are maps between string fields and string values, so they are the perfect data type to represent objects.
This command group is accessed via EsRedisClient>>hashes.
Class Methods
None
Instance Methods
hdel:fields:
  Delete one or more hash fields.
     
     Arguments:
        aKey - <String> The key of the hash.
        aCollectionOfFields - <SequenceableCollection> of <String> The fields to delete.
     Answers:
        <Integer> The number of fields that were removed from the hash.
        <EsFuture> In async mode, a future that completes with the result.
hexists:field:
  Determine if a hash field exists.
     
     Arguments:
        aKey - <String> The key of the hash.
        aField - <String> The field to check.
     Answers:
        <Boolean> True if the field exists in the hash, false otherwise.
        <EsFuture> In async mode, a future that completes with the result.
hget:field:
  Get the value of a hash field.
     
     Arguments:
        aKey - <String> The key of the hash.
        aField - <String> The field whose value to get.
     Answers:
        <String> The value of the field, or nil if the field does not exist.
        <EsFuture> In async mode, a future that completes with the result.
hgetAll:
  Get all the fields and values in a hash.
     
     Arguments:
        aKey - <String> The key of the hash.
     Answers:
        <Dictionary> A dictionary containing all fields and their values.
        <EsFuture> In async mode, a future that completes with the result.
hincrby:field:amount:
  Increment the integer value of a hash field by the given number.
     
     Arguments:
        aKey - <String> The key of the hash.
        aField - <String> The field to increment.
        anInteger - <Integer> The amount to increment by.
     Answers:
        <Integer> The value of the field after the increment.
        <EsFuture> In async mode, a future that completes with the result.
hincrbyfloat:field:amount:
  Increment the float value of a hash field by the given amount.
    
     Arguments:
        aKey - <String> The key of the hash.
        aField - <String> The field to increment.
        aFloat - <Float> The amount to increment by.
     Answers:
        <String> The value of the field after the increment.
        <EsFuture> In async mode, a future that completes with the result.
hkeys:
  Get all the fields in a hash.
     
     Arguments:
        aKey - <String> The key of the hash.
     Answers:
        <Array> An array of all the field names in the hash.
        <EsFuture> In async mode, a future that completes with the result.
hlen:
  Get the number of fields in a hash.
     
     Arguments:
        aKey - <String> The key of the hash.
     Answers:
        <Integer> The number of fields in the hash.
        <EsFuture> In async mode, a future that completes with the result.
hmget:fields:
  Get the values of all the given hash fields.
     
     Arguments:
        aKey - <String> The key of the hash.
        aCollectionOfFields - <SequenceableCollection> of <String> The fields to get.
     Answers:
        <Array of String> An array of values for the given fields, in the same order.
        <EsFuture> In async mode, a future that completes with the result.
hmset:fromDictionary:
  Set multiple hash fields to multiple values from a dictionary.
     
     Arguments:
        aKey - <String> The key of the hash.
        aDictionary - <Dictionary> The dictionary of field-value pairs to set.
     Answers:
        <String> 'OK'.
        <EsFuture> In async mode, a future that completes with the result.
hrandfield:
  Get a random field from a hash.
    
     Arguments:
        aKey - <String> The key of the hash.
     Answers:
        <String> A random field name from the hash, or nil if the hash does not exist.
        <EsFuture> In async mode, a future that completes with the result.
hrandfield:count:
  Get one or more random fields from a hash.
    
     Arguments:
        aKey - <String> The key of the hash.
        anInteger - <Integer> The number of fields to return.
     Answers:
        <Array> An array of random field names from the hash.
        <EsFuture> In async mode, a future that completes with the result.
hscan:cursor:
  Incrementally iterate over fields and values of a hash.
    
     Arguments:
        aKey - <String> The key of the hash.
        aCursor - <Integer | String> The cursor position to start from.
     Answers:
        <Array> An array where the first element is the new cursor, and the second is an array of field-value pairs.
        <EsFuture> In async mode, a future that completes with the result.
hscan:cursor:options:
  Incrementally iterate over fields and values of a hash with options.
    
     Arguments:
        aKey - <String> The key of the hash.
        aCursor - <String> The cursor.
        aCollectionOfOptions - <Collection> Optional arguments like MATCH or COUNT.
     Answers:
        <Array> An array where the first element is the new cursor, and the second is an array of field-value pairs.
        <EsFuture> In async mode, a future that completes with the result.
hset:field:value:
  Set the value of a hash field.
     
     Arguments:
        aKey - <String> The key of the hash.
        aField - <String> The field to set.
        aValue - <Object> The value to set.
     Answers:
        <Integer> 1 if a new field was created, 0 if an existing field was updated.
        <EsFuture> In async mode, a future that completes with the result.
hsetnx:field:value:
  Set the value of a hash field, only if the field does not yet exist.
    
     Arguments:
        aKey - <String> The key of the hash.
        aField - <String> The field to set.
        aValue - <Object> The value to set.
     Answers:
        <Integer> 1 if field is a new field in the hash and value was set, 0 if field already exists and no operation was performed.
        <EsFuture> In async mode, a future that completes with the result.
hstrlen:field:
  Get the length of the string value of a hash field.
    
     Arguments:
        aKey - <String> The key of the hash.
        aField - <String> The field to check.
     Answers:
        <Integer> The length of the string value of the field, or 0 if the key or the field does not exist.
        <EsFuture> In async mode, a future that completes with the result.
hvals:
  Get all the values in a hash.
     
     Arguments:
        aKey - <String> The key of the hash.
     Answers:
        <Array> An array of all the values in the hash.
        <EsFuture> In async mode, a future that completes with the result.
Last modified date: 01/22/2026