new RedisTransaction()
This Interface represents a TX
Methods
append(key, value, handler) → {RedisTransaction}
Append a value to a key
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
value |
string | Value to append |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
auth(password, handler) → {RedisTransaction}
Authenticate to the server
Parameters:
Name | Type | Description |
---|---|---|
password |
string | Password for authentication |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
bgrewriteaof(handler) → {RedisTransaction}
Asynchronously rewrite the append-only file
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
bgsave(handler) → {RedisTransaction}
Asynchronously save the dataset to disk
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
bitcount(key, handler) → {RedisTransaction}
Count set bits in a string
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
bitcountRange(key, start, end, handler) → {RedisTransaction}
Count set bits in a string
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
start |
number | Start index |
end |
number | End index |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
bitop(operation, destkey, keys, handler) → {RedisTransaction}
Perform bitwise operations between strings
Parameters:
Name | Type | Description |
---|---|---|
operation |
Object | Bitwise operation to perform |
destkey |
string | Destination key where result is stored |
keys |
Array.<string> | List of keys on which to perform the operation |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
bitpos(key, bit, handler) → {RedisTransaction}
Find first bit set or clear in a string
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
bit |
number | What bit value to look for - must be 1, or 0 |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
bitposFrom(key, bit, start, handler) → {RedisTransaction}
Find first bit set or clear in a string
See also bitposRange() method, which takes start, and stop offset.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
bit |
number | What bit value to look for - must be 1, or 0 |
start |
number | Start offset |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
bitposRange(key, bit, start, stop, handler) → {RedisTransaction}
Find first bit set or clear in a string
Note: when both start, and stop offsets are specified, behaviour is slightly different than if only start is specified
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
bit |
number | What bit value to look for - must be 1, or 0 |
start |
number | Start offset |
stop |
number | End offset - inclusive |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
blpop(key, seconds, handler) → {RedisTransaction}
Remove and get the first element in a list, or block until one is available
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string identifying a list to watch |
seconds |
number | Timeout in seconds |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
blpopMany(keys, seconds, handler) → {RedisTransaction}
Remove and get the first element in any of the lists, or block until one is available
Parameters:
Name | Type | Description |
---|---|---|
keys |
Array.<string> | List of key strings identifying lists to watch |
seconds |
number | Timeout in seconds |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
brpop(key, seconds, handler) → {RedisTransaction}
Remove and get the last element in a list, or block until one is available
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string identifying a list to watch |
seconds |
number | Timeout in seconds |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
brpoplpush(key, destkey, seconds, handler) → {RedisTransaction}
Pop a value from a list, push it to another list and return it; or block until one is available
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string identifying the source list |
destkey |
string | Key string identifying the destination list |
seconds |
number | Timeout in seconds |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
brpopMany(keys, seconds, handler) → {RedisTransaction}
Remove and get the last element in any of the lists, or block until one is available
Parameters:
Name | Type | Description |
---|---|---|
keys |
Array.<string> | List of key strings identifying lists to watch |
seconds |
number | Timeout in seconds |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clientGetname(handler) → {RedisTransaction}
Get the current connection name
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
clientKill(filter, handler) → {RedisTransaction}
Kill the connection of a client
Parameters:
Name | Type | Description |
---|---|---|
filter |
Object | Filter options |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clientList(handler) → {RedisTransaction}
Get the list of client connections
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
clientPause(millis, handler) → {RedisTransaction}
Stop processing commands from clients for some time
Parameters:
Name | Type | Description |
---|---|---|
millis |
number | Pause time in milliseconds |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clientSetname(name, handler) → {RedisTransaction}
Set the current connection name
Parameters:
Name | Type | Description |
---|---|---|
name |
string | New name for current connection |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
close(handler)
Close the client - when it is fully closed the handler will be called.
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
clusterAddslots(slots, handler) → {RedisTransaction}
Assign new hash slots to receiving node.
Parameters:
Name | Type | Description |
---|---|---|
slots |
Array.<string> | |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clusterCountFailureReports(nodeId, handler) → {RedisTransaction}
Return the number of failure reports active for a given node.
Parameters:
Name | Type | Description |
---|---|---|
nodeId |
string | |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clusterCountkeysinslot(slot, handler) → {RedisTransaction}
Return the number of local keys in the specified hash slot.
Parameters:
Name | Type | Description |
---|---|---|
slot |
number | |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clusterDelslots(slot, handler) → {RedisTransaction}
Set hash slots as unbound in receiving node.
Parameters:
Name | Type | Description |
---|---|---|
slot |
number | |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clusterDelslotsMany(slots, handler) → {RedisTransaction}
Set hash slots as unbound in receiving node.
Parameters:
Name | Type | Description |
---|---|---|
slots |
Array.<string> | |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clusterFailover(handler) → {RedisTransaction}
Forces a slave to perform a manual failover of its master.
Parameters:
Name | Type | Description |
---|---|---|
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clusterFailOverWithOptions(options, handler) → {RedisTransaction}
Forces a slave to perform a manual failover of its master.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object | |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clusterForget(nodeId, handler) → {RedisTransaction}
Remove a node from the nodes table.
Parameters:
Name | Type | Description |
---|---|---|
nodeId |
string | |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clusterGetkeysinslot(slot, count, handler) → {RedisTransaction}
Return local key names in the specified hash slot.
Parameters:
Name | Type | Description |
---|---|---|
slot |
number | |
count |
number | |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clusterInfo(handler) → {RedisTransaction}
Provides info about Redis Cluster node state.
Parameters:
Name | Type | Description |
---|---|---|
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clusterKeyslot(key, handler) → {RedisTransaction}
Returns the hash slot of the specified key.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clusterMeet(ip, port, handler) → {RedisTransaction}
Force a node cluster to handshake with another node.
Parameters:
Name | Type | Description |
---|---|---|
ip |
string | |
port |
number | |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clusterNodes(handler) → {RedisTransaction}
Get Cluster config for the node.
Parameters:
Name | Type | Description |
---|---|---|
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clusterReplicate(nodeId, handler) → {RedisTransaction}
Reconfigure a node as a slave of the specified master node.
Parameters:
Name | Type | Description |
---|---|---|
nodeId |
string | |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clusterReset(handler) → {RedisTransaction}
Reset a Redis Cluster node.
Parameters:
Name | Type | Description |
---|---|---|
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clusterResetWithOptions(options, handler) → {RedisTransaction}
Reset a Redis Cluster node.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object | |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clusterSaveconfig(handler) → {RedisTransaction}
Forces the node to save cluster state on disk.
Parameters:
Name | Type | Description |
---|---|---|
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clusterSetConfigEpoch(epoch, handler) → {RedisTransaction}
Set the configuration epoch in a new node.
Parameters:
Name | Type | Description |
---|---|---|
epoch |
number | |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clusterSetslot(slot, subcommand, handler) → {RedisTransaction}
Bind an hash slot to a specific node.
Parameters:
Name | Type | Description |
---|---|---|
slot |
number | |
subcommand |
Object | |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clusterSetslotWithNode(slot, subcommand, nodeId, handler) → {RedisTransaction}
Bind an hash slot to a specific node.
Parameters:
Name | Type | Description |
---|---|---|
slot |
number | |
subcommand |
Object | |
nodeId |
string | |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clusterSlaves(nodeId, handler) → {RedisTransaction}
List slave nodes of the specified master node.
Parameters:
Name | Type | Description |
---|---|---|
nodeId |
string | |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
clusterSlots(handler) → {RedisTransaction}
Get array of Cluster slot to node mappings
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
command(handler) → {RedisTransaction}
Get array of Redis command details
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
commandCount(handler) → {RedisTransaction}
Get total number of Redis commands
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
commandGetkeys(handler) → {RedisTransaction}
Extract keys given a full Redis command
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
commandInfo(commands, handler) → {RedisTransaction}
Get array of specific Redis command details
Parameters:
Name | Type | Description |
---|---|---|
commands |
Array.<string> | List of commands to get info for |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
configGet(parameter, handler) → {RedisTransaction}
Get the value of a configuration parameter
Parameters:
Name | Type | Description |
---|---|---|
parameter |
string | Configuration parameter |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
configResetstat(handler) → {RedisTransaction}
Reset the stats returned by INFO
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
configRewrite(handler) → {RedisTransaction}
Rewrite the configuration file with the in memory configuration
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
configSet(parameter, value, handler) → {RedisTransaction}
Set a configuration parameter to the given value
Parameters:
Name | Type | Description |
---|---|---|
parameter |
string | Configuration parameter |
value |
string | New value |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
dbsize(handler) → {RedisTransaction}
Return the number of keys in the selected database
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
debugObject(key, handler) → {RedisTransaction}
Get debugging information about a key
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
debugSegfault(handler) → {RedisTransaction}
Make the server crash
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
decr(key, handler) → {RedisTransaction}
Decrement the integer value of a key by one
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
decrby(key, decrement, handler) → {RedisTransaction}
Decrement the integer value of a key by the given number
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
decrement |
number | Value by which to decrement |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
del(key, handler) → {RedisTransaction}
Delete a key
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Keys to delete |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
delMany(keys, handler) → {RedisTransaction}
Delete many keys
Parameters:
Name | Type | Description |
---|---|---|
keys |
Array.<string> | List of keys to delete |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
discard(handler) → {RedisTransaction}
Discard all commands issued after MULTI
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
dump(key, handler) → {RedisTransaction}
Return a serialized version of the value stored at the specified key.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
echo(message, handler) → {RedisTransaction}
Echo the given string
Parameters:
Name | Type | Description |
---|---|---|
message |
string | String to echo |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
eval(script, keys, args, handler) → {RedisTransaction}
Execute a Lua script server side. Due to the dynamic nature of this command any response type could be returned
for This reason and to ensure type safety the reply is always guaranteed to be a JsonArray.
When a reply if for example a String the handler will be called with a JsonArray with a single element containing the String.
Parameters:
Name | Type | Description |
---|---|---|
script |
string | Lua script to evaluate |
keys |
Array.<string> | List of keys |
args |
Array.<string> | List of argument values |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
evalsha(sha1, keys, values, handler) → {RedisTransaction}
Execute a Lua script server side. Due to the dynamic nature of this command any response type could be returned
for This reason and to ensure type safety the reply is always guaranteed to be a JsonArray.
When a reply if for example a String the handler will be called with a JsonArray with a single element containing the String.
Parameters:
Name | Type | Description |
---|---|---|
sha1 |
string | SHA1 digest of the script cached on the server |
keys |
Array.<string> | List of keys |
values |
Array.<string> | List of values |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
exec(handler) → {RedisTransaction}
Execute all commands issued after MULTI
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
exists(key, handler) → {RedisTransaction}
Determine if a key exists
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
expire(key, seconds, handler) → {RedisTransaction}
Set a key's time to live in seconds
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
seconds |
number | Time to live in seconds |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
expireat(key, seconds, handler) → {RedisTransaction}
Set the expiration for a key as a UNIX timestamp
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
seconds |
number | Expiry time as Unix timestamp in seconds |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
flushall(handler) → {RedisTransaction}
Remove all keys from all databases
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
flushdb(handler) → {RedisTransaction}
Remove all keys from the current database
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
geoadd(key, longitude, latitude, member, handler) → {RedisTransaction}
Add one or more geospatial items in the geospatial index represented using a sorted set.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
longitude |
number | longitude |
latitude |
number | latitude |
member |
string | member |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
geoaddMany(key, members, handler) → {RedisTransaction}
Add one or more geospatial items in the geospatial index represented using a sorted set.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
members |
Array.<Object> | list of <lon, lat, member> |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
geodist(key, member1, member2, handler) → {RedisTransaction}
Return the distance between two members in the geospatial index represented by the sorted set.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
member1 |
string | member 1 |
member2 |
string | member 2 |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
geodistWithUnit(key, member1, member2, unit, handler) → {RedisTransaction}
Return the distance between two members in the geospatial index represented by the sorted set.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
member1 |
string | member 1 |
member2 |
string | member 2 |
unit |
Object | geo unit |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
geohash(key, member, handler) → {RedisTransaction}
Return valid Geohash strings representing the position of one or more elements in a sorted set value representing
a geospatial index (where elements were added using GEOADD).
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
member |
string | member |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
geohashMany(key, members, handler) → {RedisTransaction}
Return valid Geohash strings representing the position of one or more elements in a sorted set value representing
a geospatial index (where elements were added using GEOADD).
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
members |
Array.<string> | list of members |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
geopos(key, member, handler) → {RedisTransaction}
Return the positions (longitude,latitude) of all the specified members of the geospatial index represented by the
sorted set at key.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
member |
string | member |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
geoposMany(key, members, handler) → {RedisTransaction}
Return the positions (longitude,latitude) of all the specified members of the geospatial index represented by the
sorted set at key.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
members |
Array.<string> | list of members |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
georadius(key, longitude, latitude, radius, unit, handler) → {RedisTransaction}
Return the members of a sorted set populated with geospatial information using GEOADD, which are within the borders
of the area specified with the center location and the maximum distance from the center (the radius).
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
longitude |
number | longitude |
latitude |
number | latitude |
radius |
number | radius |
unit |
Object | geo unit |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
georadiusbymember(key, member, radius, unit, handler) → {RedisTransaction}
This command is exactly like GEORADIUS with the sole difference that instead of taking, as the center of the area
to query, a longitude and latitude value, it takes the name of a member already existing inside the geospatial
index represented by the sorted set.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
member |
string | member |
radius |
number | radius |
unit |
Object | geo unit |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
georadiusbymemberWithOptions(key, member, radius, unit, options, handler) → {RedisTransaction}
This command is exactly like GEORADIUS with the sole difference that instead of taking, as the center of the area
to query, a longitude and latitude value, it takes the name of a member already existing inside the geospatial
index represented by the sorted set.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
member |
string | member |
radius |
number | radius |
unit |
Object | geo unit |
options |
Object | geo radius options |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
georadiusWithOptions(key, longitude, latitude, radius, unit, options, handler) → {RedisTransaction}
Return the members of a sorted set populated with geospatial information using GEOADD, which are within the borders
of the area specified with the center location and the maximum distance from the center (the radius).
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
longitude |
number | longitude |
latitude |
number | latitude |
radius |
number | radius |
unit |
Object | geo unit |
options |
Object | geo radius options |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
get(key, handler) → {RedisTransaction}
Get the value of a key
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
getBinary(key, handler) → {RedisTransaction}
Get the value of a key - without decoding as utf-8
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
getbit(key, offset, handler) → {RedisTransaction}
Returns the bit value at offset in the string value stored at key
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
offset |
number | Offset in bits |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
getrange(key, start, end, handler) → {RedisTransaction}
Get a substring of the string stored at a key
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
start |
number | Start offset |
end |
number | End offset - inclusive |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
getset(key, value, handler) → {RedisTransaction}
Set the string value of a key and return its old value
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key of which value to set |
value |
string | New value for the key |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
hdel(key, field, handler) → {RedisTransaction}
Delete one or more hash fields
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
field |
string | Field name |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
hdelMany(key, fields, handler) → {RedisTransaction}
Delete one or more hash fields
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
fields |
Array.<string> | Field names |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
hexists(key, field, handler) → {RedisTransaction}
Determine if a hash field exists
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
field |
string | Field name |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
hget(key, field, handler) → {RedisTransaction}
Get the value of a hash field
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
field |
string | Field name |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
hgetall(key, handler) → {RedisTransaction}
Get all the fields and values in a hash
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
hincrby(key, field, increment, handler) → {RedisTransaction}
Increment the integer value of a hash field by the given number
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
field |
string | Field name |
increment |
number | Value by which to increment |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
hincrbyfloat(key, field, increment, handler) → {RedisTransaction}
Increment the float value of a hash field by the given amount
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
field |
string | Field name |
increment |
number | Value by which to increment |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
hkeys(key, handler) → {RedisTransaction}
Get all the fields in a hash
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
hlen(key, handler) → {RedisTransaction}
Get the number of fields in a hash
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
hmget(key, fields, handler) → {RedisTransaction}
Get the values of all the given hash fields
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
fields |
Array.<string> | Field names |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
hmset(key, values, handler) → {RedisTransaction}
Set multiple hash fields to multiple values
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
values |
Object | Map of field:value pairs |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
hscan(key, cursor, options, handler) → {RedisTransaction}
Incrementally iterate hash fields and associated values
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
cursor |
string | Cursor id |
options |
Object | Scan options |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
hset(key, field, value, handler) → {RedisTransaction}
Set the string value of a hash field
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
field |
string | Field name |
value |
string | New value |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
hsetnx(key, field, value, handler) → {RedisTransaction}
Set the value of a hash field, only if the field does not exist
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
field |
string | Field name |
value |
string | New value |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
hvals(key, handler) → {RedisTransaction}
Get all the values in a hash
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
incr(key, handler) → {RedisTransaction}
Increment the integer value of a key by one
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
incrby(key, increment, handler) → {RedisTransaction}
Increment the integer value of a key by the given amount
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
increment |
number | Value by which to increment |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
incrbyfloat(key, increment, handler) → {RedisTransaction}
Increment the float value of a key by the given amount
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
increment |
number | Value by which to increment |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
info(handler) → {RedisTransaction}
Get information and statistics about the server
Parameters:
Name | Type | Description |
---|---|---|
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
infoSection(section, handler) → {RedisTransaction}
Get information and statistics about the server
Parameters:
Name | Type | Description |
---|---|---|
section |
string | Specific section of information to return |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
keys(pattern, handler) → {RedisTransaction}
Find all keys matching the given pattern
Parameters:
Name | Type | Description |
---|---|---|
pattern |
string | Pattern to limit the keys returned |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
lastsave(handler) → {RedisTransaction}
Get the UNIX time stamp of the last successful save to disk
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
lindex(key, index, handler) → {RedisTransaction}
Get an element from a list by its index
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
index |
number | Index of list element to get |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
linsert(key, option, pivot, value, handler) → {RedisTransaction}
Insert an element before or after another element in a list
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
option |
Object | BEFORE or AFTER |
pivot |
string | Key to use as a pivot |
value |
string | Value to be inserted before or after the pivot |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
llen(key, handler) → {RedisTransaction}
Get the length of a list
Parameters:
Name | Type | Description |
---|---|---|
key |
string | String key |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
lpop(key, handler) → {RedisTransaction}
Remove and get the first element in a list
Parameters:
Name | Type | Description |
---|---|---|
key |
string | String key |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
lpush(key, value, handler) → {RedisTransaction}
Prepend one value to a list
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
value |
string | Value to be added at the beginning of the list |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
lpushMany(key, values, handler) → {RedisTransaction}
Prepend one or multiple values to a list
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
values |
Array.<string> | Values to be added at the beginning of the list, one by one |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
lpushx(key, value, handler) → {RedisTransaction}
Prepend a value to a list, only if the list exists
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
value |
string | Value to add at the beginning of the list |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
lrange(key, from, to, handler) → {RedisTransaction}
Get a range of elements from a list
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
from |
number | Start index |
to |
number | Stop index |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
lrem(key, count, value, handler) → {RedisTransaction}
Remove elements from a list
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
count |
number | Number of first found occurrences equal to $value to remove from the list |
value |
string | Value to be removed |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
lset(key, index, value, handler) → {RedisTransaction}
Set the value of an element in a list by its index
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
index |
number | Position within list |
value |
string | New value |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
ltrim(key, from, to, handler) → {RedisTransaction}
Trim a list to the specified range
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
from |
number | Start index |
to |
number | Stop index |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
mget(key, handler) → {RedisTransaction}
Get the value of the given key
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
mgetMany(keys, handler) → {RedisTransaction}
Get the values of all the given keys
Parameters:
Name | Type | Description |
---|---|---|
keys |
Array.<string> | List of keys to get |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
migrate(host, port, key, destdb, timeout, options, handler) → {RedisTransaction}
Atomically transfer a key from a Redis instance to another one.
Parameters:
Name | Type | Description |
---|---|---|
host |
string | Destination host |
port |
number | Destination port |
key |
string | Key to migrate |
destdb |
number | Destination database index |
timeout |
number | |
options |
Object | Migrate options |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
monitor(handler) → {RedisTransaction}
Listen for all requests received by the server in real time
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
move(key, destdb, handler) → {RedisTransaction}
Move a key to another database
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key to migrate |
destdb |
number | Destination database index |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
mset(keyvals, handler) → {RedisTransaction}
Set multiple keys to multiple values
Parameters:
Name | Type | Description |
---|---|---|
keyvals |
Object | Key value pairs to set |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
msetnx(keyvals, handler) → {RedisTransaction}
Set multiple keys to multiple values, only if none of the keys exist
Parameters:
Name | Type | Description |
---|---|---|
keyvals |
Object | Key value pairs to set |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
multi(handler) → {RedisTransaction}
Mark the start of a RedisTransaction block
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
object(key, cmd, handler) → {RedisTransaction}
Inspect the internals of Redis objects
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
cmd |
Object | Object sub command |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
persist(key, handler) → {RedisTransaction}
Remove the expiration from a key
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
pexpire(key, millis, handler) → {RedisTransaction}
Set a key's time to live in milliseconds
Parameters:
Name | Type | Description |
---|---|---|
key |
string | String key |
millis |
number | Time to live in milliseconds |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
pexpireat(key, millis, handler) → {RedisTransaction}
Set the expiration for a key as a UNIX timestamp specified in milliseconds
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
millis |
number | Expiry time as Unix timestamp in milliseconds |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
pfadd(key, element, handler) → {RedisTransaction}
Adds the specified element to the specified HyperLogLog.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
element |
string | Element to add |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
pfaddMany(key, elements, handler) → {RedisTransaction}
Adds the specified elements to the specified HyperLogLog.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
elements |
Array.<string> | Elementa to add |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
pfcount(key, handler) → {RedisTransaction}
Return the approximated cardinality of the set observed by the HyperLogLog at key.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
pfcountMany(keys, handler) → {RedisTransaction}
Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s).
Parameters:
Name | Type | Description |
---|---|---|
keys |
Array.<string> | List of keys |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
pfmerge(destkey, keys, handler) → {RedisTransaction}
Merge N different HyperLogLogs into a single one.
Parameters:
Name | Type | Description |
---|---|---|
destkey |
string | Destination key |
keys |
Array.<string> | List of source keys |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
ping(handler) → {RedisTransaction}
Ping the server
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
psetex(key, millis, value, handler) → {RedisTransaction}
Set the value and expiration in milliseconds of a key
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
millis |
number | Number of milliseconds until the key expires |
value |
string | New value for key |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
psubscribe(pattern, handler) → {RedisTransaction}
Listen for messages published to channels matching the given pattern
Parameters:
Name | Type | Description |
---|---|---|
pattern |
string | Pattern string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
psubscribeMany(patterns, handler) → {RedisTransaction}
Listen for messages published to channels matching the given patterns
Parameters:
Name | Type | Description |
---|---|---|
patterns |
Array.<string> | List of patterns |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
pttl(key, handler) → {RedisTransaction}
Get the time to live for a key in milliseconds
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
publish(channel, message, handler) → {RedisTransaction}
Post a message to a channel
Parameters:
Name | Type | Description |
---|---|---|
channel |
string | Channel key |
message |
string | Message to send to channel |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
pubsubChannels(pattern, handler) → {RedisTransaction}
Lists the currently active channels - only those matching the pattern
Parameters:
Name | Type | Description |
---|---|---|
pattern |
string | A glob-style pattern - an empty string means no pattern |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
pubsubNumpat(handler) → {RedisTransaction}
Returns the number of subscriptions to patterns (that are performed using the PSUBSCRIBE command)
Parameters:
Name | Type | Description |
---|---|---|
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
pubsubNumsub(channels, handler) → {RedisTransaction}
Returns the number of subscribers (not counting clients subscribed to patterns) for the specified channels
Parameters:
Name | Type | Description |
---|---|---|
channels |
Array.<string> | List of channels |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
punsubscribe(patterns, handler) → {RedisTransaction}
Stop listening for messages posted to channels matching the given patterns
Parameters:
Name | Type | Description |
---|---|---|
patterns |
Array.<string> | List of patterns to match against |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
randomkey(handler) → {RedisTransaction}
Return a random key from the keyspace
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
rename(key, newkey, handler) → {RedisTransaction}
Rename a key
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string to be renamed |
newkey |
string | New key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
renamenx(key, newkey, handler) → {RedisTransaction}
Rename a key, only if the new key does not exist
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string to be renamed |
newkey |
string | New key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
restore(key, millis, serialized, handler) → {RedisTransaction}
Create a key using the provided serialized value, previously obtained using DUMP.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
millis |
number | Expiry time in milliseconds to set on the key |
serialized |
string | Serialized form of the key value as obtained using DUMP |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
role(handler) → {RedisTransaction}
Return the role of the instance in the context of replication
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
rpop(key, handler) → {RedisTransaction}
Remove and get the last element in a list
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
rpoplpush(key, destkey, handler) → {RedisTransaction}
Remove the last element in a list, append it to another list and return it
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string identifying source list |
destkey |
string | Key string identifying destination list |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
rpush(key, value, handler) → {RedisTransaction}
Append one or multiple values to a list
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
value |
string | Value to be added to the end of the list |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
rpushMany(key, values, handler) → {RedisTransaction}
Append one or multiple values to a list
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
values |
Array.<string> | List of values to add to the end of the list |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
rpushx(key, value, handler) → {RedisTransaction}
Append a value to a list, only if the list exists
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
value |
string | Value to be added to the end of the list |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
sadd(key, member, handler) → {RedisTransaction}
Add a member to a set
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
member |
string | Value to be added to the set |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
saddMany(key, members, handler) → {RedisTransaction}
Add one or more members to a set
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
members |
Array.<string> | Values to be added to the set |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
save(handler) → {RedisTransaction}
Synchronously save the dataset to disk
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
scan(cursor, options, handler) → {RedisTransaction}
Incrementally iterate the keys space
Parameters:
Name | Type | Description |
---|---|---|
cursor |
string | Cursor id |
options |
Object | Scan options |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
scard(key, handler) → {RedisTransaction}
Get the number of members in a set
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
scriptExists(script, handler) → {RedisTransaction}
Check existence of script in the script cache.
Parameters:
Name | Type | Description |
---|---|---|
script |
string | SHA1 digest identifying a script in the script cache |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
scriptExistsMany(scripts, handler) → {RedisTransaction}
Check existence of scripts in the script cache.
Parameters:
Name | Type | Description |
---|---|---|
scripts |
Array.<string> | List of SHA1 digests identifying scripts in the script cache |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
scriptFlush(handler) → {RedisTransaction}
Remove all the scripts from the script cache.
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
scriptKill(handler) → {RedisTransaction}
Kill the script currently in execution.
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
scriptLoad(script, handler) → {RedisTransaction}
Load the specified Lua script into the script cache.
Parameters:
Name | Type | Description |
---|---|---|
script |
string | Lua script |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
sdiff(key, cmpkeys, handler) → {RedisTransaction}
Subtract multiple sets
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key identifying the set to compare with all other sets combined |
cmpkeys |
Array.<string> | List of keys identifying sets to subtract from the key set |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
sdiffstore(destkey, key, cmpkeys, handler) → {RedisTransaction}
Subtract multiple sets and store the resulting set in a key
Parameters:
Name | Type | Description |
---|---|---|
destkey |
string | Destination key where the result should be stored |
key |
string | Key identifying the set to compare with all other sets combined |
cmpkeys |
Array.<string> | List of keys identifying sets to subtract from the key set |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
select(dbindex, handler) → {RedisTransaction}
Change the selected database for the current connection
Parameters:
Name | Type | Description |
---|---|---|
dbindex |
number | Index identifying the new active database |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
set(key, value, handler) → {RedisTransaction}
Set the string value of a key
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key of which value to set |
value |
string | New value for the key |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
setBinary(key, value, handler) → {RedisTransaction}
Set the binary string value of a key - without encoding as utf-8
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key of which value to set |
value |
Buffer | New value for the key |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
setBinaryWithOptions(key, value, options, handler) → {RedisTransaction}
Set the string value of a key
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key of which value to set |
value |
Buffer | New value for the key |
options |
Object | Set options |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
setbit(key, offset, bit, handler) → {RedisTransaction}
Sets or clears the bit at offset in the string value stored at key
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
offset |
number | Bit offset |
bit |
number | New value - must be 1 or 0 |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
setex(key, seconds, value, handler) → {RedisTransaction}
Set the value and expiration of a key
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
seconds |
number | Number of seconds until the key expires |
value |
string | New value for key |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
setnx(key, value, handler) → {RedisTransaction}
Set the value of a key, only if the key does not exist
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key of which value to set |
value |
string | New value for the key |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
setrange(key, offset, value, handler) → {RedisTransaction}
Overwrite part of a string at key starting at the specified offset
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
offset |
number | Offset - the maximum offset that you can set is 2^29 -1 (536870911), as Redis Strings are limited to 512 megabytes |
value |
string | Value to overwrite with |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
setWithOptions(key, value, options, handler) → {RedisTransaction}
Set the string value of a key
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key of which value to set |
value |
string | New value for the key |
options |
Object | Set options |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
sinter(keys, handler) → {RedisTransaction}
Intersect multiple sets
Parameters:
Name | Type | Description |
---|---|---|
keys |
Array.<string> | List of keys to perform intersection on |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
sinterstore(destkey, keys, handler) → {RedisTransaction}
Intersect multiple sets and store the resulting set in a key
Parameters:
Name | Type | Description |
---|---|---|
destkey |
string | Key where to store the results |
keys |
Array.<string> | List of keys to perform intersection on |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
sismember(key, member, handler) → {RedisTransaction}
Determine if a given value is a member of a set
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
member |
string | Member to look for |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
slaveof(host, port, handler) → {RedisTransaction}
Make the server a slave of another instance
Parameters:
Name | Type | Description |
---|---|---|
host |
string | Host to become this server's master |
port |
number | Port of our new master |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
slaveofNoone(handler) → {RedisTransaction}
Make this server a master
Parameters:
Name | Type | Description |
---|---|---|
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
slowlogGet(limit, handler) → {RedisTransaction}
Read the Redis slow queries log
Parameters:
Name | Type | Description |
---|---|---|
limit |
number | Number of log entries to return. If value is less than zero all entries are returned |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
slowlogLen(handler) → {RedisTransaction}
Get the length of the Redis slow queries log
Parameters:
Name | Type | Description |
---|---|---|
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
slowlogReset(handler) → {RedisTransaction}
Reset the Redis slow queries log
Parameters:
Name | Type | Description |
---|---|---|
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
smembers(key, handler) → {RedisTransaction}
Get all the members in a set
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
smove(key, destkey, member, handler) → {RedisTransaction}
Move a member from one set to another
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key of source set currently containing the member |
destkey |
string | Key identifying the destination set |
member |
string | Member to move |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
sort(key, options, handler) → {RedisTransaction}
Sort the elements in a list, set or sorted set
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
options |
Object | Sort options |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
spop(key, handler) → {RedisTransaction}
Remove and return a random member from a set
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
spopMany(key, count, handler) → {RedisTransaction}
Remove and return random members from a set
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
count |
number | Number of members to remove |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
srandmember(key, handler) → {RedisTransaction}
Get one or multiple random members from a set
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
srandmemberCount(key, count, handler) → {RedisTransaction}
Get one or multiple random members from a set
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
count |
number | Number of members to get |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
srem(key, member, handler) → {RedisTransaction}
Remove one member from a set
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
member |
string | Member to remove |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
sremMany(key, members, handler) → {RedisTransaction}
Remove one or more members from a set
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
members |
Array.<string> | Members to remove |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
sscan(key, cursor, options, handler) → {RedisTransaction}
Incrementally iterate Set elements
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
cursor |
string | Cursor id |
options |
Object | Scan options |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
strlen(key, handler) → {RedisTransaction}
Get the length of the value stored in a key
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
subscribe(channel, handler) → {RedisTransaction}
Listen for messages published to the given channels
Parameters:
Name | Type | Description |
---|---|---|
channel |
string | Channel to subscribe to |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
subscribeMany(channels, handler) → {RedisTransaction}
Listen for messages published to the given channels
Parameters:
Name | Type | Description |
---|---|---|
channels |
Array.<string> | List of channels to subscribe to |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
sunion(keys, handler) → {RedisTransaction}
Add multiple sets
Parameters:
Name | Type | Description |
---|---|---|
keys |
Array.<string> | List of keys identifying sets to add up |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
sunionstore(destkey, keys, handler) → {RedisTransaction}
Add multiple sets and store the resulting set in a key
Parameters:
Name | Type | Description |
---|---|---|
destkey |
string | Destination key |
keys |
Array.<string> | List of keys identifying sets to add up |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
sync(handler) → {RedisTransaction}
Internal command used for replication
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
time(handler) → {RedisTransaction}
Return the current server time
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
ttl(key, handler) → {RedisTransaction}
Get the time to live for a key
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
type(key, handler) → {RedisTransaction}
Determine the type stored at key
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
unsubscribe(channels, handler) → {RedisTransaction}
Stop listening for messages posted to the given channels
Parameters:
Name | Type | Description |
---|---|---|
channels |
Array.<string> | List of channels to subscribe to |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
unwatch(handler) → {RedisTransaction}
Forget about all watched keys
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- RedisTransaction
wait(numSlaves, timeout, handler) → {RedisTransaction}
Wait for the synchronous replication of all the write commands sent in the context of the current connection.
Parameters:
Name | Type | Description |
---|---|---|
numSlaves |
number | |
timeout |
number | |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
watch(key, handler) → {RedisTransaction}
Watch the given keys to determine execution of the MULTI/EXEC block
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key to watch |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
watchMany(keys, handler) → {RedisTransaction}
Watch the given keys to determine execution of the MULTI/EXEC block
Parameters:
Name | Type | Description |
---|---|---|
keys |
Array.<string> | List of keys to watch |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zadd(key, score, member, handler) → {RedisTransaction}
Add one or more members to a sorted set, or update its score if it already exists
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
score |
number | Score used for sorting |
member |
string | New member key |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zaddMany(key, members, handler) → {RedisTransaction}
Add one or more members to a sorted set, or update its score if it already exists
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
members |
Array.<string> | New member keys and their scores |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zcard(key, handler) → {RedisTransaction}
Get the number of members in a sorted set
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zcount(key, min, max, handler) → {RedisTransaction}
Count the members in a sorted set with scores within the given values
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
min |
number | Minimum score |
max |
number | Maximum score |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zincrby(key, increment, member, handler) → {RedisTransaction}
Increment the score of a member in a sorted set
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
increment |
number | Increment amount |
member |
string | Member key |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zinterstore(destkey, sets, options, handler) → {RedisTransaction}
Intersect multiple sorted sets and store the resulting sorted set in a new key
Parameters:
Name | Type | Description |
---|---|---|
destkey |
string | Destination key |
sets |
Array.<string> | List of keys identifying sorted sets to intersect |
options |
Object | Aggregation options |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zinterstoreWeighed(destkey, sets, options, handler) → {RedisTransaction}
Intersect multiple sorted sets and store the resulting sorted set in a new key using weights for scoring
Parameters:
Name | Type | Description |
---|---|---|
destkey |
string | Destination key |
sets |
Array.<string> | List of keys identifying sorted sets to intersect |
options |
Object | Aggregation options |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zlexcount(key, min, max, handler) → {RedisTransaction}
Count the number of members in a sorted set between a given lexicographical range
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
min |
string | Pattern to compare against for minimum value |
max |
string | Pattern to compare against for maximum value |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zrange(key, start, stop, handler) → {RedisTransaction}
Return a range of members in a sorted set, by index
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
start |
number | Start index for the range |
stop |
number | Stop index for the range - inclusive |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zrangebylex(key, min, max, options, handler) → {RedisTransaction}
Return a range of members in a sorted set, by lexicographical range
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
min |
string | Pattern representing a minimum allowed value |
max |
string | Pattern representing a maximum allowed value |
options |
Object | Limit options where limit can be specified |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zrangebyscore(key, min, max, options, handler) → {RedisTransaction}
Return a range of members in a sorted set, by score
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
min |
string | Pattern defining a minimum value |
max |
string | Pattern defining a maximum value |
options |
Object | Range and limit options |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zrangeWithOptions(key, start, stop, options, handler) → {RedisTransaction}
Return a range of members in a sorted set, by index
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
start |
number | Start index for the range |
stop |
number | Stop index for the range - inclusive |
options |
Object | Range options |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zrank(key, member, handler) → {RedisTransaction}
Determine the index of a member in a sorted set
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
member |
string | Member in the sorted set identified by key |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zrem(key, member, handler) → {RedisTransaction}
Remove one member from a sorted set
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
member |
string | Member in the sorted set identified by key |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zremMany(key, members, handler) → {RedisTransaction}
Remove one or more members from a sorted set
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
members |
Array.<string> | Members in the sorted set identified by key |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zremrangebylex(key, min, max, handler) → {RedisTransaction}
Remove all members in a sorted set between the given lexicographical range
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
min |
string | Pattern defining a minimum value |
max |
string | Pattern defining a maximum value |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zremrangebyrank(key, start, stop, handler) → {RedisTransaction}
Remove all members in a sorted set within the given indexes
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
start |
number | Start index |
stop |
number | Stop index |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zremrangebyscore(key, min, max, handler) → {RedisTransaction}
Remove all members in a sorted set within the given scores
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
min |
string | Pattern defining a minimum value |
max |
string | Pattern defining a maximum value |
handler |
function |
Returns:
- Type
- RedisTransaction
zrevrange(key, start, stop, options, handler) → {RedisTransaction}
Return a range of members in a sorted set, by index, with scores ordered from high to low
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
start |
number | Start index for the range |
stop |
number | Stop index for the range - inclusive |
options |
Object | Range options |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zrevrangebylex(key, max, min, options, handler) → {RedisTransaction}
Return a range of members in a sorted set, by score, between the given lexicographical range with scores ordered from high to low
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
max |
string | Pattern defining a maximum value |
min |
string | Pattern defining a minimum value |
options |
Object | Limit options |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zrevrangebyscore(key, max, min, options, handler) → {RedisTransaction}
Return a range of members in a sorted set, by score, with scores ordered from high to low
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
max |
string | Pattern defining a maximum value |
min |
string | Pattern defining a minimum value |
options |
Object | Range and limit options |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zrevrank(key, member, handler) → {RedisTransaction}
Determine the index of a member in a sorted set, with scores ordered from high to low
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
member |
string | Member in the sorted set identified by key |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zscan(key, cursor, options, handler) → {RedisTransaction}
Incrementally iterate sorted sets elements and associated scores
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
cursor |
string | Cursor id |
options |
Object | Scan options |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zscore(key, member, handler) → {RedisTransaction}
Get the score associated with the given member in a sorted set
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key string |
member |
string | Member in the sorted set identified by key |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zunionstore(destkey, sets, options, handler) → {RedisTransaction}
Add multiple sorted sets and store the resulting sorted set in a new key
Parameters:
Name | Type | Description |
---|---|---|
destkey |
string | Destination key |
sets |
Array.<string> | List of keys identifying sorted sets |
options |
Object | Aggregation options |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction
zunionstoreWeighed(key, sets, options, handler) → {RedisTransaction}
Add multiple sorted sets using weights, and store the resulting sorted set in a new key
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Destination key |
sets |
Array.<string> | Map containing set-key:weight pairs |
options |
Object | Aggregation options |
handler |
function | Handler for the result of this call. |
Returns:
- Type
- RedisTransaction