Skip to content

Redis Connector Reference

To use the Redis connector, add the element in your configuration before carrying out any other Redis operations.

redis.init - Standalone mode

The redis.init operation initializes the connector to interact with Redis.

Parameter Name Description Required
redisHost The Redis host name (default localhost). Yes
redisPort The port on which the Redis server is running (the default port is 6379). Yes
maxConnections The maximum number of connections that are supported by the pool (which should be less than the max client connection limit of Redis) Yes
redisTimeout The server TTL (Time to Live) in milliseconds. Optional. The default is 2000ms.
redisConnectionTimeout The connection TTL (Time to live) in milliseconds. Optional. The default equals to the redisTimeout.
redisConnectionPoolId We are keeping separate pools for each artifact by using ARTIFACT_NAME as a unique name. If and only if the user wants to add 2 or more connectors to a single artifact (say 2 connectors per one API) then the user has to differentiate the Redis connectors within that artifact with-param. Optional

Sample configuration

<redis.init>
    <redisHost>{$ctx:redisHost}</redisHost>
    <redisPort>{$ctx:redisPort}</redisPort>
    <redisTimeout>{$ctx:redisTimeout}</redisTimeout>
    <redisConnectionTimeout>{$ctx:redisConnectionTimeout}</redisConnectionTimeout>
</redis.init>

If you are connecting using a cache key, use the following init configuration.

Parameter Name Description Required
cacheKey Key of the cache (password). Optional
useSsl A flag to switch between SSL and non-SSL. Optional. Default is false.

Sample configuration

<redis.init>
    <redisHost>{$ctx:redisHost}</redisHost>
    <redisPort>{$ctx:redisPort}</redisPort>
    <redisTimeout>{$ctx:redisTimeout}</redisTimeout>
    <redisConnectionTimeout>{$ctx:redisConnectionTimeout}</redisConnectionTimeout>
    <cacheKey>{$ctx:cacheKey}</cacheKey>
    <useSsl>{$ctx:useSsl}</useSsl>
</redis.init>

If you prefer to use the connectionURI over above configuration, use the following init configuration.

Parameter Name Description Required
redisConnectionURI The Redis connection URI in the form of redis://[user:password@]host[:port]/[database] or rediss://[user:password@]host[:port]/[database] to connect over TLS/SSL Yes
redisTimeout The server TTL (Time to Live) in milliseconds. Optional. The default is 2000ms.
redisConnectionTimeout The connection TTL (Time to live) in milliseconds. Optional. The default equals to the redisTimeout.

Sample configuration

<redis.init>
    <redisConnectionURI>{$ctx:redisConnectionURI}</redisConnectionURI>
    <redisTimeout>{$ctx:redisTimeout}</redisTimeout>
    <redisConnectionTimeout>{$ctx:redisConnectionTimeout}</redisConnectionTimeout>
</redis.init>

redis.init - Cluster mode

The redis.init operation initializes the connector to interact with Redis cluster.

Parameter Name Description Required
isJmxEnabled A flag to enable JMX if required (Default is false). No
redisClusterEnabled A flag to enable the redis cluster mode (Default is false). Yes
clusterNodes Comma separated list of the cluster nodes as Node1_hostname:Port,Node2_hostname:Port, etc. Example: 127.0.0.1:40001,127.0.0.1:40002 Yes
redisTimeout The server TTL (Time to Live) in milliseconds. Optional. The default is 2000ms.
redisConnectionTimeout The connection TTL (Time to live) in milliseconds. Optional. The default equals to the redisTimeout.
maxAttempts The number of retries. Optional. The default is 5.
clientName Name of the client. Optional. Default is empty
cacheKey Key of the cache (password). Optional.
useSsl A flag to switch between SSL and non-SSL. Optional. Default is false.

Sample configuration

<redis.init>
    <redisHost>{$ctx:redisHost}</redisHost>
    <redisPort>{$ctx:redisPort}</redisPort>
    <redisTimeout>{$ctx:redisTimeout}</redisTimeout>
    <redisConnectionTimeout>{$ctx:redisConnectionTimeout}</redisConnectionTimeout>
    <maxAttempts>5</maxAttempts>   
    <clientName>WSO2EI</clientName>
</redis.init>

If you are connecting using a cache key, use the following init configuration.

Sample configuration

<redis.init>
    <redisHost>{$ctx:redisHost}</redisHost>
    <redisPort>{$ctx:redisPort}</redisPort>
    <redisTimeout>{$ctx:redisTimeout}</redisTimeout>
    <redisConnectionTimeout>{$ctx:redisConnectionTimeout}</redisConnectionTimeout>
    <maxAttempts>5</maxAttempts>   
    <clientName>WSO2EI</clientName>
    <cacheKey>{$ctx:cacheKey}</cacheKey>
    <useSsl>{$ctx:useSsl}</useSsl>
</redis.init>

redis.init - sentinel mode

The redis.init operation initializes the connector to interact with the Redis cluster. Sentinel password configuration is available from version 2.5.0

Parameter Name Description Required
sentinelEnabled A flag to enable the sentinel cluster mode (this is false by default). Yes
sentinels Comma separated list of the sentinel nodes in the following format: Node1_hostname:Port,Node2_hostname:Port, etc. For example: 172.18.0.4:26379,172.18.0.5:26379 Yes
sentinelSoTimeout The server TTL (Time to Live) in milliseconds. Optional. The default is 2000ms.
sentinelConnectionTimeout The connection TTL (Time to live) in milliseconds. Optional. The default equals to the redisTimeout.
sentinelPassword The password of the sentinel node (if configured only) Optional

Sample configuration

<redis.init>
    <sentinelUser>{$ctx:sentinelUser}</sentinelUser>
    <sentinelPassword>{$ctx:sentinelPassword}</sentinelPassword>
    <masterName>{$ctx:masterName}</masterName>
    <masterUser>{$ctx:masterName}</masterUser>
    <masterPassword>{$ctx:masterPassword}</masterPassword>
    <sentinelEnabled>true</sentinelEnabled>
    <dbNumber>0</dbNumber>
    <sentinels>172.18.0.4:26379,172.18.0.5:26379,172.18.0.6:26379</sentinels>
    <sentinelClientName>{$ctx:sentinelClientName}</sentinelClientName>
    <sentinelConnectionTimeout>{$ctx:sentinelConnectionTimeout}</sentinelConnectionTimeout>
    <sentinelSoTimeout>{$ctx:sentinelSoTimeout}</sentinelSoTimeout>
</redis.init>


Connection Commands

echo

The echo operation returns a specified string. See the related documentation for more information.

Parameter Name Description Required
redisMessage The message that you want to echo. Yes

Sample configuration

<redis.echo>
    <redisMessage>{$ctx:redisMessage}</redisMessage>
</redis.echo>

Sample request

{
    "redisMessage":"sampleMessage"
}
ping

The ping operation pings the server to verify whether the connection is still alive. See the related documentation for more information.

Sample configuration

<redis.ping/>

Sample request

An empty request can be handled by the ping operation.

quit

The quit operation closes the connection to the server. See the related documentation for more information.

Sample configuration

<redis.quit/>

Sample request

An empty request can be handled by the quit operation.

Hashes

hDel

The hDel operation deletes one or more specified hash fields. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the hash is stored. Yes
redisFields The fields that you want to delete. Yes

Sample configuration

<redis.hDel>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisFields>{$ctx:redisFields}</redisFields>
</redis.hDel>

Sample request

{
    "redisKey":"sampleKey",
    "redisFields":"sampleField1 sampleField2"
}
hExists

The hExists operation determines whether a specified hash field exists. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the hash is stored. Yes
redisFields The fields that determine existence. Yes

Sample configuration

<redis.hExists>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisFields>{$ctx:redisFields}</redisFields>
</redis.hExists>

Sample request

{
    "redisKey":"sampleKey",
    "redisFields":"sampleField"
}
hGet

The hGet operation retrieves the value of a particular field in a hash stored in a specified key. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the hash is stored. Yes
redisFields The field for which you want to retrieve the value. Yes

Sample configuration

<redis.hGet>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisFields>{$ctx:redisFields}</redisFields>
</redis.hGet>

Sample request

{
    "redisKey":"sampleKey",
    "redisFields":"sampleField"
}
hGetAll

The hGetAll operation retrieves all the fields and values of a hash stored in a specified key. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the hash is stored. Yes

Sample configuration

<redis.hGetAll>
    <redisKey>{$ctx:redisKey}</redisKey>
</redis.hGetAll>

Sample request

{
    "redisKey":"sampleKey"
}
hIncrBy

The hIncrBy operation increments the integer value of a hash field by the specified amount. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the hash is stored. Yes
redisFields The hash field for which you want to increment the value. Yes
redisValue The amount by which you want to increment the hash field value. Yes

Sample configuration

<redis.hIncrBy>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisField>{$ctx:redisField}</redisField>
    <redisValue>{$ctx:redisValue}</redisValue>
</redis.hIncrBy>

Sample request

{
    "redisKey":"sampleKey",
    "redisField":"sampleField",
    "redisValue":"1"
}
hKeys

The hKeys operation retrieves all the fields in a hash. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the hash is stored. Yes

Sample configuration

<redis.hKeys>
    <redisKey>{$ctx:redisKey}</redisKey>
</redis.hKeys>

Sample request

{
    "redisKey":"sampleKey"
}
hLen

The hLen operation retrieves the number of fields in a hash. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the hash is stored. Yes

Sample configuration

<redis.hKeys>
    <redisKey>{$ctx:redisKey}</redisKey>
</redis.hKeys>

Sample request

{
    "redisKey":"sampleKey"
}
hMGet

The hMGet operation retrieves values associated with each of the specified fields in a hash that is stored in a particular key. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the hash is stored. Yes
redisFields The hash field for which you want to retrieve values. Yes

Sample configuration

<redis.hMGet>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisFields>{$ctx:redisFields}</redisFields>
</redis.hMGet>

Sample request

{
    "redisKey":"sampleKey",
    "redisFields":"sampleField1 sampleField2"
}
hMSet

The hMSet operation sets specified fields to their respective values in the hash stored in a particular key. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the hash is stored. Yes
redisFieldsValues The fields you want to set and their respective values. Yes

Sample configuration

<redis.hMSet>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisFieldsValues>{$ctx:redisFieldsValues}</redisFieldsValues>
</redis.hMSet>

Sample request

{
    "redisKey":"sampleKey",
    "redisFieldsValues":"sampleField1 sampleValue1 sampleField2 sampleValue2"
}
hSet

The hSet operation sets a specific field in a hash to a specified value. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the hash is stored. Yes
redisFields The field for which you want to set a value. Yes
redisValue The amount by which you want to increment the hash field value. Yes

Sample configuration

<redis.hSet>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisField>{$ctx:redisField}</redisField>
    <redisValue>{$ctx:redisValue}</redisValue>
</redis.hSet>

Sample request

{
    "redisKey":"sampleKey",
    "redisField":"sampleField",
    "redisValue":"1"
}
hSetnX

The hSetnX operation sets a specified field to a value, only if the field does not already exist in the hash. If field already exists, this operation has no effect. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the hash is stored. Yes
redisFields The field for which you want to set a value. Yes
redisValue The amount by which you want to increment the hash field value. Yes

Sample configuration

<redis.hSetnX>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisField>{$ctx:redisField}</redisField>
    <redisValue>{$ctx:redisValue}</redisValue>
</redis.hSetnX>

Sample request

{
    "redisKey":"sampleKey",
    "redisField":"sampleField",
    "redisValue":"1"
}
hVals

The hVals operation retrieves all values in a hash that is stored in a particular key. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the hash is stored. Yes

Sample configuration

<redis.hVals>
    <redisKey>{$ctx:redisKey}</redisKey>
</redis.hVals>

Sample request

{
    "redisKey":"sampleKey"
}

Keys

del

The del operation deletes a specified key if it exists. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key that you want to delete. Yes

Sample configuration

<redis.del>
    <redisKey>{$ctx:redisKey}</redisKey>
</redis.del>

Sample request

{
    "redisKey":"sampleKey"
}
exists

The exists operation determines whether a specified key exists. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key that you want to determine existence. Yes

Sample configuration

<redis.exists>
    <redisKey>{$ctx:redisKey}</redisKey>
</redis.exists>

Sample request

{
    "redisKey":"sampleKey"
}
expire

The expire operation sets a TTL(Time to live) for a key so that the key will automatically delete once it reaches the TTL. The TTL should be specified in seconds. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key that you want to specify a TTL. Yes
redisSeconds The number of seconds representing the TTL that you want to set for the key. Yes

Sample configuration

<redis.expire>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisSeconds>{$ctx:redisSeconds}</redisSeconds>
</redis.expire>

Sample request

{
    "redisKey":"sampleKey",
    "redisSeconds":"10"
}
expireAt

The expireAt operation sets the time after which an existing key should expire. Here the time should be specified as a UNIX timestamp. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key that you want to set an expiration. Yes
redisUnixTime The time to expire specified in the UNIX timestamp format. Yes

Sample configuration

<redis.expire>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisUnixTime>{$ctx:redisUnixTime}</redisUnixTime>
</redis.expire>

Sample request

{
    "redisKey":"sampleKey",
    "redisUnixTime":"1293840000"
}
keys

The keys operation retrieves all keys that match a specified pattern. See the related documentation for more information.

Parameter Name Description Required
redisPattern The pattern that you want to match when retrieving keys. Yes

Sample configuration

<redis.keys>
    <redisPattern>{$ctx:redisPattern}</redisPattern>
</redis.keys>

Sample request

{
    "redisPattern":"*"
}
randomKey

A sample request with an empty body can be handled by the randomKey operation. See the related documentation for more information.

Sample configuration

<redis.randomKey/>

Sample request

{
    "redisPattern":"*"
}
rename

The rename operation renames an existing key to a new name that is specified. See the related documentation for more information.

Parameter Name Description Required
redisOldKey The name of an existing key that you want to rename. Yes
redisNewKey The new name that you want the key to have. Yes

Sample configuration

<redis.rename>
    <redisOldKey>{$ctx:redisOldKey}</redisOldKey>
    <redisNewKey>{$ctx:redisNewKey}</redisNewKey>
</redis.rename>

Sample request

{
    "redisOldKey":"sampleOldKey",
    "redisNewKey":"sampleNewKey"
}
renamenX

The renamenX operation renames a key to a new key, only if the new key does not already exist. See the related documentation for more information.

Parameter Name Description Required
redisOldKey The name of an existing key that you want to rename. Yes
redisNewKey The new name that you want the key to have. Yes

Sample configuration

<redis.renamenX>
    <redisOldKey>{$ctx:redisOldKey}</redisOldKey>
    <redisNewKey>{$ctx:redisNewKey}</redisNewKey>
</redis.renamenX>

Sample request

{
    "redisOldKey":"sampleOldKey",
    "redisNewKey":"sampleNewKey"
}
ttl

The ttl operation retrieves the TTL (Time to Live) value of a specified key. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key for which you want to retrieve the TTL. Yes

Sample configuration

<redis.ttl>
    <redisKey>{$ctx:redisKey}</redisKey>
</redis.ttl>

Sample request

{
    "redisKey":"sampleKey"
}
type

The type operation retrieves the data type of a value stored in a specified key. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key that the value is stored. Yes

Sample configuration

<redis.type>
    <redisKey>{$ctx:redisKey}</redisKey>
</redis.type>

Sample request

{
    "redisKey":"sampleKey"
}

Lists

blPop

The blPop operation retrieves the first element in a list, if available, or blocks the connection for a specified amount of time until an element is available. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the list is stored. Yes
redisBrPopTimeout The amount of time to keep the connection blocked, waiting for an element to be available in the tail of the list. Yes

Sample configuration

<redis.brPop>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisBrPopTimeout>{$ctx:redisBrPopTimeout}</redisBrPopTimeout>
</redis.brPop>

Sample request

{
    "redisKey":"sampleKey"
    "redisBrPopTimeout":"0"
}
brPop

The brPop operation retrieves the last element in a list, if available, or blocks the connection for a specified amount of time until an element is available. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the list is stored. Yes
redisBlPopTimeout The amount of time to keep the connection blocked, waiting for an element to be available in the head of the list. Yes

Sample configuration

<redis.blPop>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisBlPopTimeout>{$ctx:redisBlPopTimeout}</redisBlPopTimeout>
</redis.blPop>

Sample request

{
    "redisKey":"sampleKey"
    "redisBlPopTimeout":"0"
}
lInsert

The lInsert operation inserts a specified element before or after an existing element in a list that is stored in a specified key. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the list is stored. Yes
redisWhere The place where you want to add an element. Possible values are BEFORE or AFTER. For example, whether you want to add an element before a particular element that exists in the list. Yes
redisPivot An existing element in the list that is used as the pivot element. Yes
redisValue The element that you want to insert to the list. Yes

Sample configuration

<redis.lInsert>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisWhere>{$ctx:redisWhere}</redisWhere>
    <redisPivot>{$ctx:redisPivot}</redisPivot>
    <redisValue>{$ctx:redisValue}</redisValue>
</redis.lInsert>

Sample request

{
    "redisKey":"sampleKey",
    "redisWhere":"BEFORE",
    "redisPivot":"samplePivotElement",
    "redisValue":"sampleInsertElement"
}
lLen

The lLen operation retrieves the length of a list that is stored in a specified key. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the list is stored. Yes

Sample configuration

<redis.lLen>
    <redisKey>{$ctx:redisKey}</redisKey>
</redis.lLen>

Sample request

{
    "redisKey":"sampleKey",
}
lPop

The lPop operation retrieves the first element in a list that is stored in a specified key. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the list is stored. Yes

Sample configuration

<redis.lLen>
    <redisKey>{$ctx:redisKey}</redisKey>
</redis.lLen>

Sample request

{
    "redisKey":"sampleKey"
}
lPush

The lPush operation inserts one or more elements to the head of a list that is stored in a specified key. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the list is stored. Yes
redisStrings One or more elements that you want to add to the head of the list. Yes

Sample configuration

<redis.lPush>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisStrings>{$ctx:redisStrings}</redisStrings>
</redis.lPush>

Sample request

{
    "redisKey":"sampleKey",
    "redisStrings":"sampleValues"
}
lPushX

The lPushX operation inserts one or more elements to the head of a list stored in a specified key, only if the key already exists and holds a list. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the list is stored. Yes
redisStrings One or more elements that you want to add to the head of the list. Yes

Sample configuration

<redis.lPushX>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisStrings>{$ctx:redisStrings}</redisStrings>
</redis.lPushX>

Sample request

{
    "redisKey":"sampleKey",
    "redisStrings":"sampleValues"
}
lRange

The lRange operation retrieves a range of elements from a list. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the list is stored. Yes
redisStart The starting index. Yes
redisEnd The ending index. Yes

Sample configuration

<redis.lRange>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisStart>{$ctx:redisStart}</redisStart>
    <redisEnd>{$ctx:redisEnd}</redisEnd>
</redis.lRange>

Sample request

{
    "redisKey":"sampleKey",
    "redisStart":"0",
    "redisEnd":"-1"
}
lRem

The lRem operation removes elements from a list. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the list is stored. Yes
redisCount The number of occurrences of the element that you want to remove. Yes
redisValue The element that you want to remove. Yes

Sample configuration

<redis.lRem>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisCount>{$ctx:redisCount}</redisCount>
    <redisValue>{$ctx:redisValue}</redisValue>
</redis.lRem>

Sample request

{
    "redisKey":"sampleKey",
    "redisCount":"1",
    "redisValue":"sampleValue"
}
lSet

The lSet operation sets the value of an element in a list by its index. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the list is stored. Yes
redisIndex The starting index. Yes
redisValue The value of the key Yes

Sample configuration

<redis.lSet>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisIndex>{$ctx:redisIndex}</redisIndex>
    <redisValue>{$ctx:redisValue}</redisValue>
</redis.lSet>

Sample request

{
    "redisKey":"sampleKey",
    "redisIndex":"0",
    "redisValue":"sampleValue"
}
lTrim

The lTrim operation trims a list to a specified range. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the list is stored. Yes
redisStart The starting index. Yes
redisEnd The ending index. Yes

Sample configuration

<redis.lTrim>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisStart>{$ctx:redisStart}</redisStart>
    <redisEnd>{$ctx:redisEnd}</redisEnd>
</redis.lTrim>

Sample request

{
    "redisKey":"sampleKey",
    "redisStart":"0",
    "redisEnd":"-1"
}
rPopLPush

The rPopLPush operation removes the last element in a list, then inserts it to another list, and then returns it. See the related documentation for more information.

Parameter Name Description Required
redisSrckey The name of the source key from where the last element is retrieved. Yes
redisDstkey The name of destination key. Yes

Sample configuration

<redis.rPopLPush>
    <redisSrckey>{$ctx:redisSrckey}</redisSrckey>
    <redisDstkey>{$ctx:redisDstkey}</redisDstkey>
</redis.rPopLPush>

Sample request

{
    "redisSrckey":"sampleSourceKey",
    "redisDstkey":"sampleDestinationKey"
}
rPush

The rPush operation inserts one or more elements to the tail of a list that is stored in a specified key. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the list is stored. Yes
redisStrings One or more elements that you want to add to the tail of the list. Yes

Sample configuration

<redis.rPush>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisStrings>{$ctx:redisStrings}</redisStrings>
</redis.rPush>

Sample request

{
    "redisKey":"sampleKey",
    "redisStrings":"sampleValues"
}
rPushX

The rPushX operation inserts one or more elements to the tail of a list stored in a specified key, only if the key already exists and holds a list. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key where the list is stored. Yes
redisValue One or more elements that you want to add to the tail of the list. Yes

Sample configuration

<redis.rPushX>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisValue>{$ctx:redisValue}</redisValue>
</redis.rPushX>

Sample request

{
    "redisKey":"sampleKey",
    "redisValue":"sampleValue"
}

Server Commands

flushAll

The flushAll operation deletes all the keys from all existing databases. See the related documentation for more information.

Sample configuration

<redis.flushAll/>

Sample request

A sample request with an empty body can be handled by the flushAll operation.

flushDB

The flushDB operation deletes all the keys from the currently selected database. See the related documentation for more information.

Sample configuration

<redis.flushDB/>

Sample request

A sample request with an empty body can be handled by the flushDB operation.

Sets

sadd

The sadd operation is used to add one or more members to a set. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key. Yes
redisMembers The value to be added to the key. Yes

Sample configuration

<redis.sadd>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisMembers>{$ctx:redisMembers}</redisMembers>
</redis.sadd>

Sample request

{
    "redisKey":"sampleKey",
    "redisMembers":"sampleValue"
}
sDiffStore

The sDiffStore operation is used to subtract multiple sets and store the resulting set in a key. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key. Yes
redisDstkey The name of the destination key. Yes

Sample configuration

<redis.sDiffStore>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisDstkey>{$ctx:redisDstkey}</redisDstkey>
</redis.sDiffStore>

Sample request

{
    "redisKey":"sampleKey",
    "redisDstkey":"sampleDestinationKey"
}
sInter

The sInter operation is used to intersect multiple sets. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key. Yes

Sample configuration

<redis.sInter>
    <redisKey>{$ctx:redisKey}</redisKey>
</redis.sInter>

Sample request

{
    "redisKey":"sampleKey"
}
sInterStore

The sInterStore operation is used to intersect multiple sets and store the resulting set in a key. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key. Yes
redisDstkey The name of the destination key. Yes

Sample configuration

<redis.sDiffStore>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisDstkey>{$ctx:redisDstkey}</redisDstkey>
</redis.sDiffStore>

Sample request

{
    "redisKey":"sampleKey",
    "redisDstkey":"sampleDestinationKey"
}
sIsMember

The sIsMember operation is used to determine if a given value is a member of a set. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key. Yes
redisMembers The name of a member in a key. Yes

Sample configuration

<redis.sIsMember>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisMembers>{$ctx:redisMembers}</redisMembers>
</redis.sIsMember>

Sample request

{
    "redisKey":"sampleKey",
    "redisMembers":"sampleValue"
}
sMembers

The sMembers operation is used to get the all members in a set. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key. Yes

Sample configuration

<redis.sMembers>
    <redisKey>{$ctx:redisKey}</redisKey>
</redis.sMembers>

Sample request

{
    "redisKey":"sampleKey"
}
sMove

The sMove operation is used to move a member from one set to another. See the related documentation for more information.

Parameter Name Description Required
redisSrckey The name of the source key. Yes
redisDstkey The name of the destination key. Yes
redisMember The name of the member. Yes

Sample configuration

<redis.sMove>
    <redisSrckey>{$ctx:redisSrckey}</redisSrckey>
    <redisDstkey>{$ctx:redisDstkey}</redisDstkey>
    <redisMember>{$ctx:redisMember}</redisMember>
</redis.sMove>

Sample request

{
    "redisSrckey":"sampleSourceKey",
    "redisDstkey":"sampleDestinationKey",
    "redisMember":"sampleMember"
}
sPop

The sPop operation is used to remove and return one or multiple random members from a set. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key. Yes

Sample configuration

<redis.sPop>
    <redisKey>{$ctx:redisKey}</redisKey>
</redis.sPop>

Sample request

{
    "redisKey":"sampleKey"
}
sRandMember

The sRandMember operation is used to get one or multiple random members from a set. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key. Yes

Sample configuration

<redis.sRandMember>
    <redisKey>{$ctx:redisKey}</redisKey>
</redis.sRandMember>

Sample request

{
    "redisKey":"sampleKey"
}
sRem

The sRem operation is used to remove one or more members from a set. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key. Yes
redisMembers The name of a member in a key. Yes

Sample configuration

<redis.sRem>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisMembers>{$ctx:redisMembers}</redisMembers>
</redis.sRem>

Sample request

{
    "redisKey":"sampleKey",
    "redisMembers":"sampleValue"
}
sUnion

The sUnion operation is used to add multiple sets. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key. Yes

Sample configuration

<redis.sUnion>
    <redisKey>{$ctx:redisKey}</redisKey>
</redis.sUnion>

Sample request

{
    "redisKey":"sampleKey"
}
sUnionStore

The sUnionStore operation is used to add multiple sets and store the resulting set in a key. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key. Yes
redisDstkey The name of the destination key. Yes

Sample configuration

<redis.sUnionStore>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisDstkey>{$ctx:redisDstkey}</redisDstkey>
</redis.sUnionStore>

Sample request

{
    "redisKey":"sampleKey",
    "redisDstkey":"sampleValue"
}

Sorted Sets

zadd

The zadd operation adds one or more members to a sorted set, or update its score if a specified member already exists. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key. Yes
redisScore The score of the sorted set. Yes
redisMembers The name of a member you want to add. Yes

Sample configuration

<redis.zadd>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisScore>{$ctx:redisScore}</redisScore>
    <redisMember>{$ctx:redisMember}</redisMember>
</redis.zadd>

Sample request

{
    "redisKey":"sampleKey",
    "redisScore":"1.1",
    "redisMembers":"sampleMember"
}
zCount

The zCount operation retrieves a count of members in a sorted set, with scores that are within the min and max values specified. See the related documentation for more information.

Parameter Name Description Required
redisKey The name of the key. Yes
redisMin The minimum score value. Yes
redisMax The maximum score value. Yes

Sample configuration

<redis.zCount>
    <redisKey>{$ctx:redisKey}</redisKey>
    <redisMin>{$ctx:redisMin}</redisMin>
    <redisMax>{$ctx:redisMax}</redisMax>
</redis.zCount>

Sample request

{
    "redisKey":"sampleKey",
    "redisMin":"1.1",
    "redisMax":"2.2"
}