Programmer Reference : Redis : EsRedisStringCommands
EsRedisStringCommands
Description
Provides an API for the Redis String commands. The Redis string type is the simplest type of value you can associate with a Redis key. It is the only data type in Redis that can store any kind of data, from a string of text to a JPEG image.
This command group is accessed via EsRedisClient>>strings.
Class Methods
None
Instance Methods
append:value:
  Append a value to a key.
     
     Arguments:
        aKey - <String> The key to append to.
        aValue - <Object> The value to append.
     Answers:
        <Integer> The length of the string after the append operation.
        <EsFuture> In async mode, a future that completes with the result.
decr:
  Decrement the integer value of a key by one.
     
     Arguments:
        aKey - <String>
     Answers:
        <Integer> The value of key after the decrement.
        <EsFuture> In async mode, a future that completes with the result.
decrby:amount:
  Decrement the integer value of a key by the given amount.
     
     Arguments:
        aKey - <String>
        anInteger - <Integer> The amount to decrement by.
     Answers:
        <Integer> The value of key after the decrement.
        <EsFuture> In async mode, a future that completes with the result.
get:
  Get the value of a key.
     
     Arguments:
        aKey - <String>
     Answers:
        <String> The value of the key, or nil if the key does not exist.
        <EsFuture> In async mode, a future that completes with the result.
getdel:
  Get the value of a key and delete the key.
     
     Arguments:
        aKey - <String>
     Answers:
        <String | ByteArray> The value of the key, or nil if the key does not exist.
        <EsFuture> In async mode, a future that completes with the result.
getex:options:
  Get the value of a key and optionally set its expiration.
    
    Arguments:
        aKey - <String> The key to get.
        aCollectionOfOptions - <Collection> Options like EX, PX, EXAT, PXAT, PERSIST.
    Answers:
        <String> The value of the key, or nil if the key does not exist.
        <EsFuture> In async mode, a future that completes with the result.
getrange:start:end:
  Get a substring of the string stored at a key. This is the official command, SUBSTR is deprecated.
    
     Arguments:
        aKey - <String> The key of the string.
        startInteger - <Integer> The starting offset.
        endInteger - <Integer> The ending offset.
     Answers:
        <String> The substring.
        <EsFuture> In async mode, a future that completes with the result.
getset:value:
  Set the value of a key and return its old value.
     
     Arguments:
        aKey - <String>
        aValue - <Object> The new value.
     Answers:
        <String> The old value, or nil if the key didn't exist.
        <EsFuture> In async mode, a future that completes with the result.
incr:
  Increment the integer value of a key by one.
     
     Arguments:
        aKey - <String>
     Answers:
        <Integer> The value of key after the increment.
        <EsFuture> In async mode, a future that completes with the result.
incrby:amount:
  Increment the integer value of a key by the given amount.
     
     Arguments:
        aKey - <String>
        anInteger - <Integer> The amount to increment by.
     Answers:
        <Integer> The value of key after the increment.
        <EsFuture> In async mode, a future that completes with the result.
incrbyfloat:amount:
  Increment the float value of a key by the given amount.
     
     Arguments:
        aKey - <String>
        aFloat - <Float> The amount to increment by.
     Answers:
        <String> The value of key after the increment.
        <EsFuture> In async mode, a future that completes with the result.
lcs:key:
  Find the longest common subsequence between two strings.
    
     Arguments:
        aKey1 - <String> The first key.
        aKey2 - <String> The second key.
     Answers:
        <String> The longest common subsequence.
        <EsFuture> In async mode, a future that completes with the result.
lcs:key:options:
  Find the longest common subsequence between two strings with options.
    
     Arguments:
        aKey1 - <String> The first key.
        aKey2 - <String> The second key.
        aCollectionOfOptions - <Collection> Optional arguments like LEN, IDX.
     Answers:
        <Object> The result, which can be an Integer or an Array depending on options.
        <EsFuture> In async mode, a future that completes with the result.
mget:
  Get the values of all the given keys.
     
     Arguments:
        aCollectionOfKeys - <SequenceableCollection> of <String>
     Answers:
        <Array> A list of values at the specified keys.
        <EsFuture> In async mode, a future that completes with the result.
mset:
  Set multiple keys to multiple values from a dictionary.
     
     Arguments:
        aDictionary - <Dictionary> A dictionary of key-value pairs.
     Answers:
        <String> 'OK'.
        <EsFuture> In async mode, a future that completes with the result.
msetnx:
  Set multiple keys to multiple values, only if none of the keys exist.
    
     Arguments:
        aDictionary - <Dictionary> A dictionary of key-value pairs.
     Answers:
        <Integer> 1 if all keys were set, 0 if no key was set.
        <EsFuture> In async mode, a future that completes with the result.
set:value:
  Set the value of a key.
     
     Arguments:
        aKey - <String>
        aValue - <Object> The value to set.
     Answers:
        <String> 'OK'.
        <EsFuture> In async mode, a future that completes with the result.
set:value:ifNotExists:
  Set the value of a key, only if the key does not exist.
     
     Arguments:
        aKey - <String>
        aValue - <Object> The value to set.
        aBoolean - <Boolean> If true, performs the 'NX' operation.
     Answers:
        <String> 'OK' if the key was set.
        <nil> If the key was not set.
        <EsFuture> In async mode, a future that completes with the result.
set:value:options:
  Set the string value of a key, with additional options.
    
     Arguments:
        aKey - <String> The key.
        aValue - <Object> The value.
        aCollectionOfOptions - <Collection> Optional arguments like EX, PX, NX, XX, KEEPTTL, GET.
     Answers:
        <Object> 'OK' or nil if the key was not set (due to NX/XX), or the old value if GET is used.
        <EsFuture> In async mode, a future that completes with the result.
setrange:offset:value:
  Overwrites part of the string stored at key, starting at the specified offset.
    
     Arguments:
        aKey - <String> The key.
        anInteger - <Integer> The offset.
        aValue - <Object> The value to write.
     Answers:
        <Integer> The length of the string after it was modified.
        <EsFuture> In async mode, a future that completes with the result.
strlen:
  Get the length of the value stored in a key.
     
     Arguments:
        aKey - <String>
     Answers:
        <Integer> The length of the string at key.
        <EsFuture> In async mode, a future that completes with the result.
Last modified date: 01/22/2026