RedisCluster
class RedisCluster (View source)
Helper autocomplete for php redis cluster extension.
Constants
| OPT_SLAVE_FAILOVER |
Options |
| FAILOVER_NONE |
Cluster options |
| FAILOVER_ERROR |
|
| FAILOVER_DISTRIBUTE |
|
| FAILOVER_DISTRIBUTE_SLAVES |
|
Methods
Creates a Redis Cluster client
Disconnects from the RedisCluster instance, except when pconnect is used.
Get the value related to the specified key
Set the string value in argument as value of the key.
Returns the values of all specified keys.
Sets multiple key-value pairs in one atomic command.
No description
Remove specified keys.
Set the string value in argument as value of the key, with a time to live.
PSETEX works exactly like SETEX with the sole difference that the expire time is specified in milliseconds instead of seconds.
Set the string value in argument as value of the key if the key doesn't already exist in the database.
Sets a value and returns the previous entry at that key.
Verify if the specified key exists.
Returns the keys that match a certain pattern.
Returns the type of data pointed by a given key.
Returns and removes the first element of the list.
Returns and removes the last element of the list.
Set the list at index with the new value.
Removes and returns a random element from the set value at Key.
Adds the string values to the head (left) of the list. Creates the list if the key didn't exist.
Adds the string values to the tail (right) of the list. Creates the list if the key didn't exist.
BLPOP is a blocking list pop primitive.
BRPOP is a blocking list pop primitive.
Adds the string value to the tail (right) of the list if the ist exists. FALSE in case of Failure.
Adds the string value to the head (left) of the list if the list exists.
Insert value in the list before or after the pivot value. the parameter options specify the position of the insert (before or after). If the list didn't exists, or the pivot didn't exists, the value is not inserted.
Return the specified element of the list stored at the specified key.
Removes the first count occurrences of the value element from the list.
A blocking version of rpoplpush, with an integral timeout in the third parameter.
Pops a value from the tail of a list, and pushes it to the front of another list.
Returns the size of a list identified by Key. If the list didn't exist or is empty, the command returns 0. If the data type identified by Key is not a list, the command return FALSE.
Returns the set cardinality (number of elements) of the set stored at key.
Returns all the members of the set value stored at key.
Returns if member is a member of the set stored at key.
Adds a values to the set value stored at key.
Adds a values to the set value stored at key.
Removes the specified members from the set value stored at key.
Performs the union between N sets and returns it.
Performs the same action as sUnion, but stores the result in the first key
Returns the members of a set resulting from the intersection of all the sets held at the specified keys. If just a single key is specified, then this command produces the members of this set. If one of the keys is missing, FALSE is returned.
Performs a sInter command and stores the result in a new set.
Performs the difference between N sets and returns it.
Performs the same action as sDiff, but stores the result in the first key
Returns a random element(s) from the set value at Key, without removing it.
Get the length of a string value.
Remove the expiration timer from a key.
Returns the remaining time to live of a key that has a timeout.
Returns the remaining time to live of a key that has an expire set, with the sole difference that TTL returns the amount of remaining time in seconds while PTTL returns it in milliseconds. In Redis 2.6 or older the command returns -1 if the key does not exist or if the key exist but has no associated expire. Starting with Redis 2.8 the return value in case of error changed: Returns -2 if the key does not exist. Returns -1 if the key exists but has no associated expire.
Returns the cardinality of an ordered set.
Returns the number of elements of the sorted set stored at the specified key which have scores in the range [start,end]. Adding a parenthesis before start or end excludes it from the range. +inf and -inf are also valid limits.
Deletes the elements of the sorted set stored at the specified key which have scores in the range [start,end].
Returns the score of a given member in the specified sorted set.
Adds the specified member with a given score to the sorted set stored at key.
Increments the score of a member from a sorted set by a given amount.
Returns the length of a hash, in number of items
Returns the keys in a hash, as an array of strings.
Returns the values in a hash, as an array of strings.
Gets a value from the hash stored at key.
Returns the whole hash, as an array of strings indexed by strings.
Verify if the specified member exists in a key.
Increments the value of a member from a hash by a given amount.
Adds a value to the hash stored at key. If this value is already in the hash, FALSE is returned.
Adds a value to the hash stored at key only if this field isn't already in the hash.
Retrieve the values associated to the specified fields in the hash.
Fills in a whole hash. Non-string values are converted to string, using the standard (string) cast.
Removes a values from the hash stored at key.
Increment the float value of a hash field by the given amount
Dump a key out of a redis database, the value of which can later be passed into redis using the RESTORE command.
Returns the rank of a given member in the specified sorted set, starting at 0 for the item with the smallest score. zRevRank starts at 0 for the item with the largest score.
No description
Increment the number stored at key by one.
Decrement the number stored at key by one.
Increment the number stored at key by one. If the second argument is filled, it will be used as the integer value of the increment.
Decrement the number stored at key by one. If the second argument is filled, it will be used as the integer value of the decrement.
Increment the float value of a key by the given amount
Sets an expiration date (a timeout) on an item.
Sets an expiration date (a timeout in milliseconds) on an item.
Sets an expiration date (a timestamp) on an item.
Sets an expiration date (a timestamp) on an item. Requires a timestamp in milliseconds
Append specified string to the string stored in specified key.
Return a single bit out of a larger string
Changes a single bit of a string.
Bitwise operation on multiple keys.
Return the position of the first bit set to 1 or 0 in a string. The position is returned, thinking of the string as an array of bits from left to right, where the first byte's most significant bit is at position 0, the second byte's most significant bit is at position 8, and so forth.
Count bits in a string.
No description
Return a substring of a larger string
Trims an existing list so that it will contain only a specified range of elements.
Returns the specified elements of the list stored at the specified key in the range [start, end]. start and stop are interpretated as indices: 0 the first element, 1 the second ... -1 the last element, -2 the penultimate .
Deletes the elements of the sorted set stored at the specified key which have rank in the range [start,end].
Publish messages to channels. Warning: this function will probably change in the future.
Renames a key.
Renames a key.
When called with a single key, returns the approximated cardinality computed by the HyperLogLog data structure stored at the specified variable, which is 0 if the variable does not exist.
Adds all the element arguments to the HyperLogLog data structure stored at the key.
Merge multiple HyperLogLog values into an unique value that will approximate the cardinality of the union of the observed Sets of the source HyperLogLog structures.
Changes a substring of a larger string.
Restore a key from the result of a DUMP operation.
Moves the specified member from the set at srcKey to the set at dstKey.
Returns a range of elements from the ordered set stored at the specified key, with values in the range [start, end]. start and stop are interpreted as zero-based indices: 0 the first element, 1 the second ... -1 the last element, -2 the penultimate .
Returns the elements of the sorted set stored at the specified key in the range [start, end] in reverse order. start and stop are interpretated as zero-based indices: 0 the first element, 1 the second ... -1 the last element, -2 the penultimate .
Returns the elements of the sorted set stored at the specified key which have scores in the range [start,end]. Adding a parenthesis before start or end excludes it from the range.
No description
Returns a range of members in a sorted set, by lexicographical range
No description
Count the number of members in a sorted set between a given lexicographical range.
Remove all members in a sorted set between the given lexicographical range.
Add multiple sorted sets and store the resulting sorted set in a new key
Intersect multiple sorted sets and store the resulting sorted set in a new key
Deletes a specified member from the ordered set.
Sort
Describes the object pointed to by a key.
Subscribe to channels. Warning: this function will probably change in the future.
Subscribe to channels by pattern
Unsubscribes the client from the given channels, or from all of them if none is given.
Unsubscribes the client from the given patterns, or from all of them if none is given.
Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself.
Scan the keyspace for keys.
Scan a set for members.
Scan a sorted set for members, with optional pattern and count.
Scan a HASH value for members, with an optional pattern and count.
Detect whether we're in ATOMIC/MULTI/PIPELINE mode.
The last error message (if any)
Clear the last error message
Get client option
Set client option.
A utility method to prefix the key with the prefix setting for phpredis.
A utility method to serialize values manually. This method allows you to serialize a value with whatever serializer is configured, manually. This can be useful for serialization/unserialization of data going in and out of EVAL commands as phpredis can't automatically do this itself. Note that if no serializer is set, phpredis will change Array values to 'Array', and Objects to 'Object'.
A utility method to unserialize data with whatever serializer is set up. If there is no serializer set, the value will be returned unchanged. If there is a serializer set up, and the data passed in is malformed, an exception will be thrown. This can be useful if phpredis is serializing values, and you return something from redis in a LUA script that is serialized.
Return all redis master nodes
Enter and exit transactional mode.
No description
No description
Watches a key for modifications by another client. If the key is modified between WATCH and EXEC, the MULTI/EXEC transaction will fail (return FALSE). unwatch cancels all the watching of all keys by this client.
No description
Performs a synchronous save at a specific node.
Performs a background save at a specific node.
Removes all entries from the current database at a specific node.
Removes all entries from all databases at a specific node.
Returns the current database's size at a specific node.
Starts the background rewrite of AOF (Append-Only File) at a specific node.
Returns the timestamp of the last disk save at a specific node.
Returns an associative array of strings and integers
No description
Returns a random key at the specified node
Return the specified node server time.
Check the specified node status
Returns message.
Returns Array reply of details about all Redis Cluster commands.
Send arbitrary things to the redis server at the specified node
Executes cluster command
Allows you to get information of the cluster client
Get or Set the redis config keys.
A command allowing you to get information on the Redis pub/sub system.
Execute the Redis SCRIPT command to perform various operations on the scripting subsystem.
This function is used in order to read and reset the Redis slow queries log.
Add one or more geospatial items in the geospatial index represented using a sorted set
Returns members of a geospatial index as standard geohash strings
Returns longitude and latitude of members of a geospatial index
Returns the distance between two members of a geospatial index
Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a point
Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a member
Compress a value with the currently configured compressor as set with RedisCluster::setOption().
Uncompress the provided value with the currently configured compressor as set with RedisCluster::setOption().
A utility method to pack a value with whatever serializer and compressor are configured.
Compute the XXH3 digest of a PHP value after it has been _packed, producing
the same digest Redis' DIGEST command would return for the stored value.
A utility method to unpack a value that has been packed with the configured serializer and compressor.
Return the last redirection that occurred while executing a command against the cluster.
Execute the Redis ACL command on the given node.
Block the client up to the provided timeout until a certain number of replicas have confirmed receiving the write operations.
Block the client until all previous write and AOF operations have been persisted to disk on the given number of local and replica AOFs.
Move an element from one list into another.
Move one or more element from one list to another.
Move an element from one list to another, blocking up to a timeout until an element is available.
Move one or more element from one list to another, blocking up to a timeout until an element is available.
Pop the highest scoring member(s) from one or more sorted sets, blocking until one is available.
Pop the lowest scoring member(s) from one or more sorted sets, blocking until one is available.
Pop one or more of the highest or lowest scoring members from one or more sorted sets, blocking up to the given timeout until an element is available.
Pop one or more of the highest or lowest scoring members from one or more sorted sets.
Pop one or more elements from the first non-empty list, blocking up to the given timeout until an element is available.
Pop one or more elements from the first non-empty list.
Copy a key to another key. Note that in a cluster both keys must map to the same slot.
Delete a key conditionally based on its value or hash digest.
Delete a key if it's equal to the specified value. This command is specific to Valkey >= 9.0.
Set one or more keys and values with optional expiry information.
Decrement a floating point value stored at a key by the provided amount.
Evaluate a LUA script on the redis server.
A read-only variant of EVAL that can be run against a replica.
A read-only variant of EVALSHA that can be run against a replica.
Update one or more keys last modified metadata.
Get the expiration of a key as a unix timestamp in seconds.
Get the expiration of a key as a unix timestamp in milliseconds.
A read-only variant of GEORADIUS that can be run against a replica.
A read-only variant of GEORADIUSBYMEMBER that can be run against a replica.
Search a geospatial index for members inside an area of a box or circle.
Search a geospatial index for members inside an area of a box or circle, storing the result in a new set.
Get the value of a key and delete it in one atomic operation.
Retrieve a value and metadata of a key.
Get the value of a key and optionally set its expiration in one atomic operation.
Find the longest common subsequence between two string keys. Note that both keys must map to the same slot.
Retrieve the number of bytes sent and received on the connection.
Reset the transferred bytes counters for the connection.
Set an expiration on a specific hash field. This command is specific to KeyDB/Valkey.
Set the expiration of a specific hash field to a unix timestamp. This command is specific to KeyDB/Valkey.
Get one or more random fields from a hash.
Get the string length of a hash field's value.
Retrieve a value and metadata of a hash field.
Get one or more fields from a hash with optional expiration information.
Set one or more fields in a hash with optional expiration information.
Get one or more fields from a hash and delete them.
Set an expiration (in seconds) on one or more fields of a hash.
Set an expiration (in milliseconds) on one or more fields of a hash.
Set the expiration of one or more fields of a hash to a unix timestamp in seconds.
Set the expiration of one or more fields of a hash to a unix timestamp in milliseconds.
Get the remaining time to live (in seconds) of one or more fields of a hash.
Get the remaining time to live (in milliseconds) of one or more fields of a hash.
Get the expiration of one or more fields of a hash as a unix timestamp in seconds.
Get the expiration of one or more fields of a hash as a unix timestamp in milliseconds.
Remove the expiration from one or more fields of a hash.
Get the position(s) of an element in a list.
Compute the intersection of one or more sets and return the cardinality of the result.
Compute the union of one or more sets and return the cardinality of the result.
Compute the difference of one or more sets and return the cardinality of the result.
Check whether one or more values are members of a set.
A read-only variant of SORT that can be run against a replica.
Delete one or more keys from the cluster without blocking, reclaiming memory in a background thread.
Acknowledge one or more pending messages that were consumed with XREADGROUP.
Append a new message to a stream.
Claim ownership of one or more pending stream messages for a given consumer.
Remove one or more messages from a stream.
Remove one or more IDs from a stream with extended options.
Perform various operations on consumer groups for a particular stream.
Automatically claim and transfer ownership of pending messages that have been idle for a given time.
Retrieve information about a stream, its consumer groups, or its consumers.
Get the number of messages in a stream.
Retrieve information about pending messages in a consumer group.
Get a range of messages from a stream in chronological order.
Read messages from one or more streams.
Read messages from one or more streams as part of a consumer group.
Get a range of messages from a stream in reverse chronological order.
Truncate a stream to a given maximum length or minimum ID.
Compute the intersection of one or more sorted sets and return the cardinality of the result.
Pop one or more of the highest scoring members from a sorted set.
Pop one or more of the lowest scoring members from a sorted set.
Store a range of a sorted set into a new sorted set. Note that both keys must map to the same slot.
Get one or more random members from a sorted set.
Get the scores of one or more members in a sorted set.
Compute the intersection of one or more sorted sets and return the result.
Compute the difference of one or more sorted sets and store the result in a new sorted set.
Compute the union of one or more sorted sets and return the result.
Compute the difference of one or more sorted sets and return the result.
Add an element to a vector set.
Query similarity of a vector by element or scores.
Get the number of elements in a vector set.
Get the number of dimensions in a vector set.
Get various bits of information about a vector set.
Check if an element is a member of a vector set.
Get the embeddings for a specific member of a vector set.
Get one or more random members from a vector set.
Retrieve a lexicographical range of elements from a vector set.
Remove an element from a vector set.
Get any adjacent values for a member of a vector set.
Get the attributes of a vector set element.
Set the attributes of a vector set element.
Get rate limiting information for a key using the GCRA (Generic Cell Rate Algorithm).
Ask the server for the XXH3 digest of a given key's value.
Details
__construct(string|null $name, array|null $seeds = null, int|float $timeout = 0, int|float $read_timeout = 0, bool $persistent = false, mixed $auth = null, array|null $context = null)
Creates a Redis Cluster client
bool
close()
Disconnects from the RedisCluster instance, except when pconnect is used.
mixed
get(string $key)
Get the value related to the specified key
RedisCluster|string|bool
set(string $key, mixed $value, mixed $options = null)
Set the string value in argument as value of the key.
RedisCluster|array|false
mget(array $keys)
Returns the values of all specified keys.
For every key that does not hold a string value or does not exist, the special value false is returned. Because of this, the operation never fails.
RedisCluster|bool
mset(array $key_values)
Sets multiple key-value pairs in one atomic command.
MSETNX only returns TRUE if all the keys were set (see SETNX).
RedisCluster|array|false
msetnx(array $key_values)
No description
RedisCluster|int|false
del(array|string $key, string ...$other_keys)
Remove specified keys.
RedisCluster|bool
setex(string $key, int $expire, mixed $value)
Set the string value in argument as value of the key, with a time to live.
RedisCluster|bool
psetex(string $key, int $timeout, string $value)
PSETEX works exactly like SETEX with the sole difference that the expire time is specified in milliseconds instead of seconds.
RedisCluster|bool
setnx(string $key, mixed $value)
Set the string value in argument as value of the key if the key doesn't already exist in the database.
RedisCluster|string|bool
getset(string $key, mixed $value)
Sets a value and returns the previous entry at that key.
RedisCluster|int|bool
exists(mixed $key, mixed ...$other_keys)
Verify if the specified key exists.
RedisCluster|array|false
keys(string $pattern)
Returns the keys that match a certain pattern.
RedisCluster|int|false
type(string $key)
Returns the type of data pointed by a given key.
RedisCluster|bool|string|array
lPop(string $key, int $count = 0)
Returns and removes the first element of the list.
RedisCluster|bool|string|array
rPop(string $key, int $count = 0)
Returns and removes the last element of the list.
RedisCluster|bool
lSet(string $key, int $index, mixed $value)
Set the list at index with the new value.
RedisCluster|string|array|false
sPop(string $key, int $count = 0)
Removes and returns a random element from the set value at Key.
RedisCluster|int|bool
lPush(string $key, mixed $value, mixed ...$other_values)
Adds the string values to the head (left) of the list. Creates the list if the key didn't exist.
If the key exists and is not a list, FALSE is returned.
RedisCluster|int|false
rPush(string $key, mixed ...$elements)
Adds the string values to the tail (right) of the list. Creates the list if the key didn't exist.
If the key exists and is not a list, FALSE is returned.
RedisCluster|array|null|false
blPop(string|array $key, string|float|int $timeout_or_key, mixed ...$extra_args)
BLPOP is a blocking list pop primitive.
It is the blocking version of LPOP because it blocks the connection when there are no elements to pop from any of the given lists. An element is popped from the head of the first list that is non-empty, with the given keys being checked in the order that they are given.
RedisCluster|array|null|false
brPop(string|array $key, string|float|int $timeout_or_key, mixed ...$extra_args)
BRPOP is a blocking list pop primitive.
It is the blocking version of RPOP because it blocks the connection when there are no elements to pop from any of the given lists. An element is popped from the tail of the first list that is non-empty, with the given keys being checked in the order that they are given. See the BLPOP documentation(https://redis.io/commands/blpop) for the exact semantics, since BRPOP is identical to BLPOP with the only difference being that it pops elements from the tail of a list instead of popping from the head.
RedisCluster|bool|int
rPushx(string $key, string $value)
Adds the string value to the tail (right) of the list if the ist exists. FALSE in case of Failure.
RedisCluster|int|bool
lPushx(string $key, mixed $value)
Adds the string value to the head (left) of the list if the list exists.
RedisCluster|int|false
lInsert(string $key, string $pos, mixed $pivot, mixed $value)
Insert value in the list before or after the pivot value. the parameter options specify the position of the insert (before or after). If the list didn't exists, or the pivot didn't exists, the value is not inserted.
mixed
lindex(string $key, int $index)
Return the specified element of the list stored at the specified key.
0 the first element, 1 the second ... -1 the last element, -2 the penultimate ... Return FALSE in case of a bad index or a key that doesn't point to a list.
RedisCluster|int|bool
lrem(string $key, mixed $value, int $count = 0)
Removes the first count occurrences of the value element from the list.
If count is zero, all the matching elements are removed. If count is negative, elements are removed from tail to head.
mixed
brpoplpush(string $srckey, string $deskey, int $timeout)
A blocking version of rpoplpush, with an integral timeout in the third parameter.
RedisCluster|bool|string
rpoplpush(string $src, string $dst)
Pops a value from the tail of a list, and pushes it to the front of another list.
Also return this value.
RedisCluster|int|bool
lLen(string $key)
Returns the size of a list identified by Key. If the list didn't exist or is empty, the command returns 0. If the data type identified by Key is not a list, the command return FALSE.
RedisCluster|int|false
scard(string $key)
Returns the set cardinality (number of elements) of the set stored at key.
RedisCluster|array|false
sMembers(string $key)
Returns all the members of the set value stored at key.
This has the same effect as running SINTER with one argument key.
RedisCluster|bool
sismember(string $key, mixed $value)
Returns if member is a member of the set stored at key.
RedisCluster|int|false
sAdd(string $key, mixed $value, mixed ...$other_values)
Adds a values to the set value stored at key.
If this value is already in the set, FALSE is returned.
RedisCluster|bool|int
sAddArray(string $key, array $values)
Adds a values to the set value stored at key.
If this value is already in the set, FALSE is returned.
RedisCluster|int|false
srem(string $key, mixed $value, mixed ...$other_values)
Removes the specified members from the set value stored at key.
RedisCluster|bool|array
sUnion(string $key, string ...$other_keys)
Performs the union between N sets and returns it.
RedisCluster|int|false
sUnionStore(string $dst, string $key, string ...$other_keys)
Performs the same action as sUnion, but stores the result in the first key
RedisCluster|array|false
sInter(array|string $key, string ...$other_keys)
Returns the members of a set resulting from the intersection of all the sets held at the specified keys. If just a single key is specified, then this command produces the members of this set. If one of the keys is missing, FALSE is returned.
RedisCluster|int|false
sInterStore(array|string $key, string ...$other_keys)
Performs a sInter command and stores the result in a new set.
RedisCluster|array|false
sDiff(string $key, string ...$other_keys)
Performs the difference between N sets and returns it.
RedisCluster|int|false
sDiffStore(string $dst, string $key, string ...$other_keys)
Performs the same action as sDiff, but stores the result in the first key
RedisCluster|string|array|false
sRandMember(string $key, int $count = 0)
Returns a random element(s) from the set value at Key, without removing it.
RedisCluster|int|false
strlen(string $key)
Get the length of a string value.
RedisCluster|bool
persist(string $key)
Remove the expiration timer from a key.
RedisCluster|int|false
ttl(string $key)
Returns the remaining time to live of a key that has a timeout.
This introspection capability allows a Redis client to check how many seconds a given key will continue to be part of the dataset. In Redis 2.6 or older the command returns -1 if the key does not exist or if the key exist but has no associated expire. Starting with Redis 2.8 the return value in case of error changed: Returns -2 if the key does not exist. Returns -1 if the key exists but has no associated expire.
RedisCluster|int|false
pttl(string $key)
Returns the remaining time to live of a key that has an expire set, with the sole difference that TTL returns the amount of remaining time in seconds while PTTL returns it in milliseconds. In Redis 2.6 or older the command returns -1 if the key does not exist or if the key exist but has no associated expire. Starting with Redis 2.8 the return value in case of error changed: Returns -2 if the key does not exist. Returns -1 if the key exists but has no associated expire.
RedisCluster|int|false
zCard(string $key)
Returns the cardinality of an ordered set.
RedisCluster|int|false
zCount(string $key, string $start, string $end)
Returns the number of elements of the sorted set stored at the specified key which have scores in the range [start,end]. Adding a parenthesis before start or end excludes it from the range. +inf and -inf are also valid limits.
RedisCluster|int|false
zRemRangeByScore(string $key, string $min, string $max)
Deletes the elements of the sorted set stored at the specified key which have scores in the range [start,end].
RedisCluster|float|false
zScore(string $key, mixed $member)
Returns the score of a given member in the specified sorted set.
RedisCluster|int|float|false
zAdd(string $key, array|float $score_or_options, mixed ...$more_scores_and_mems)
Adds the specified member with a given score to the sorted set stored at key.
RedisCluster|float|false
zIncrBy(string $key, float $value, string $member)
Increments the score of a member from a sorted set by a given amount.
RedisCluster|int|false
hLen(string $key)
Returns the length of a hash, in number of items
RedisCluster|array|false
hKeys(string $key)
Returns the keys in a hash, as an array of strings.
RedisCluster|array|false
hVals(string $key)
Returns the values in a hash, as an array of strings.
mixed
hGet(string $key, string $member)
Gets a value from the hash stored at key.
If the hash table doesn't exist, or the key doesn't exist, FALSE is returned.
RedisCluster|array|false
hGetAll(string $key)
Returns the whole hash, as an array of strings indexed by strings.
RedisCluster|bool
hExists(string $key, string $member)
Verify if the specified member exists in a key.
RedisCluster|int|false
hIncrBy(string $key, string $member, int $value)
Increments the value of a member from a hash by a given amount.
RedisCluster|int|false
hSet(string $key, string $member, mixed $value)
Adds a value to the hash stored at key. If this value is already in the hash, FALSE is returned.
RedisCluster|bool
hSetNx(string $key, string $member, mixed $value)
Adds a value to the hash stored at key only if this field isn't already in the hash.
RedisCluster|array|false
hMget(string $key, array $keys)
Retrieve the values associated to the specified fields in the hash.
RedisCluster|bool
hMset(string $key, array $key_values)
Fills in a whole hash. Non-string values are converted to string, using the standard (string) cast.
NULL values are stored as empty strings
RedisCluster|int|false
hDel(string $key, string $member, string ...$other_members)
Removes a values from the hash stored at key.
If the hash table doesn't exist, or the key doesn't exist, FALSE is returned.
RedisCluster|float|false
hIncrByFloat(string $key, string $member, float $value)
Increment the float value of a hash field by the given amount
RedisCluster|string|false
dump(string $key)
Dump a key out of a redis database, the value of which can later be passed into redis using the RESTORE command.
The data that comes out of DUMP is a binary representation of the key as Redis stores it.
RedisCluster|int|false
zRank(string $key, mixed $member)
Returns the rank of a given member in the specified sorted set, starting at 0 for the item with the smallest score. zRevRank starts at 0 for the item with the largest score.
RedisCluster|int|false
zRevRank(string $key, mixed $member)
No description
RedisCluster|int|false
incr(string $key, int $by = 1)
Increment the number stored at key by one.
RedisCluster|int|false
decr(string $key, int $by = 1)
Decrement the number stored at key by one.
RedisCluster|int|false
incrBy(string $key, int $value)
Increment the number stored at key by one. If the second argument is filled, it will be used as the integer value of the increment.
RedisCluster|int|false
decrBy(string $key, int $value)
Decrement the number stored at key by one. If the second argument is filled, it will be used as the integer value of the decrement.
RedisCluster|float|false
incrByFloat(string $key, float $value)
Increment the float value of a key by the given amount
RedisCluster|bool
expire(string $key, int $timeout, string|null $mode = null)
Sets an expiration date (a timeout) on an item.
RedisCluster|bool
pexpire(string $key, int $timeout, string|null $mode = null)
Sets an expiration date (a timeout in milliseconds) on an item.
RedisCluster|bool
expireAt(string $key, int $timestamp, string|null $mode = null)
Sets an expiration date (a timestamp) on an item.
RedisCluster|bool
pexpireAt(string $key, int $timestamp, string|null $mode = null)
Sets an expiration date (a timestamp) on an item. Requires a timestamp in milliseconds
RedisCluster|bool|int
append(string $key, mixed $value)
Append specified string to the string stored in specified key.
RedisCluster|int|false
getBit(string $key, int $value)
Return a single bit out of a larger string
RedisCluster|int|false
setBit(string $key, int $offset, bool $onoff)
Changes a single bit of a string.
RedisCluster|bool|int
bitop(string $operation, string $deskey, string $srckey, string ...$otherkeys)
Bitwise operation on multiple keys.
RedisCluster|int|false
bitpos(string $key, bool $bit, int $start = 0, int $end = -1, bool $bybit = false)
Return the position of the first bit set to 1 or 0 in a string. The position is returned, thinking of the string as an array of bits from left to right, where the first byte's most significant bit is at position 0, the second byte's most significant bit is at position 8, and so forth.
RedisCluster|bool|int
bitcount(string $key, int $start = 0, int $end = -1, bool $bybit = false)
Count bits in a string.
RedisCluster|string|bool
lGet(string $key, int $index)
No description
RedisCluster|string|false
getRange(string $key, int $start, int $end)
Return a substring of a larger string
RedisCluster|bool
ltrim(string $key, int $start, int $end)
Trims an existing list so that it will contain only a specified range of elements.
RedisCluster|array|false
lrange(string $key, int $start, int $end)
Returns the specified elements of the list stored at the specified key in the range [start, end]. start and stop are interpretated as indices: 0 the first element, 1 the second ... -1 the last element, -2 the penultimate .
..
RedisCluster|int|false
zRemRangeByRank(string $key, string $min, string $max)
Deletes the elements of the sorted set stored at the specified key which have rank in the range [start,end].
RedisCluster|bool|int
publish(string $channel, string $message)
Publish messages to channels. Warning: this function will probably change in the future.
RedisCluster|bool
rename(string $key_src, string $key_dst)
Renames a key.
RedisCluster|bool
renameNx(string $key, string $newkey)
Renames a key.
Same as rename, but will not replace a key if the destination already exists. This is the same behaviour as setNx.
RedisCluster|int|false
pfcount(string $key)
When called with a single key, returns the approximated cardinality computed by the HyperLogLog data structure stored at the specified variable, which is 0 if the variable does not exist.
RedisCluster|bool
pfadd(string $key, array $elements)
Adds all the element arguments to the HyperLogLog data structure stored at the key.
RedisCluster|bool
pfmerge(string $key, array $keys)
Merge multiple HyperLogLog values into an unique value that will approximate the cardinality of the union of the observed Sets of the source HyperLogLog structures.
RedisCluster|int|false
setRange(string $key, int $offset, string $value)
Changes a substring of a larger string.
RedisCluster|bool
restore(string $key, int $timeout, string $value, array|null $options = null)
Restore a key from the result of a DUMP operation.
RedisCluster|bool
sMove(string $src, string $dst, string $member)
Moves the specified member from the set at srcKey to the set at dstKey.
RedisCluster|array|bool
zRange(string $key, mixed $start, mixed $end, array|bool|null $options = null)
Returns a range of elements from the ordered set stored at the specified key, with values in the range [start, end]. start and stop are interpreted as zero-based indices: 0 the first element, 1 the second ... -1 the last element, -2 the penultimate .
..
RedisCluster|bool|array
zRevRange(string $key, string $min, string $max, array|null $options = null)
Returns the elements of the sorted set stored at the specified key in the range [start, end] in reverse order. start and stop are interpretated as zero-based indices: 0 the first element, 1 the second ... -1 the last element, -2 the penultimate .
..
RedisCluster|array|false
zRangeByScore(string $key, string $start, string $end, array $options = [])
Returns the elements of the sorted set stored at the specified key which have scores in the range [start,end]. Adding a parenthesis before start or end excludes it from the range.
+inf and -inf are also valid limits.
zRevRangeByScore returns the same items in reverse order, when the start and end parameters are swapped.
RedisCluster|bool|array
zRevRangeByScore(string $key, string $min, string $max, array|null $options = null)
No description
RedisCluster|array|false
zRangeByLex(string $key, string $min, string $max, int $offset = -1, int $count = -1)
Returns a range of members in a sorted set, by lexicographical range
RedisCluster|bool|array
zRevRangeByLex(string $key, string $min, string $max, array|null $options = null)
No description
RedisCluster|int|false
zLexCount(string $key, string $min, string $max)
Count the number of members in a sorted set between a given lexicographical range.
RedisCluster|int|false
zRemRangeByLex(string $key, string $min, string $max)
Remove all members in a sorted set between the given lexicographical range.
RedisCluster|int|false
zunionstore(string $dst, array $keys, array|null $weights = null, string|null $aggregate = null)
Add multiple sorted sets and store the resulting sorted set in a new key
RedisCluster|int|false
zinterstore(string $dst, array $keys, array|null $weights = null, string|null $aggregate = null)
Intersect multiple sorted sets and store the resulting sorted set in a new key
RedisCluster|int|false
zRem(string $key, string $value, string ...$other_values)
Deletes a specified member from the ordered set.
RedisCluster|array|bool|int|string
sort(string $key, array|null $options = null)
Sort
RedisCluster|int|string|false
object(string $subcommand, string $key)
Describes the object pointed to by a key.
The information to retrieve (string) and the key (string). Info can be one of the following:
- "encoding"
- "refcount"
- "idletime"
void
subscribe(array $channels, callable $cb)
Subscribe to channels. Warning: this function will probably change in the future.
void
psubscribe(array $patterns, callable $callback)
Subscribe to channels by pattern
bool|array
unsubscribe(array $channels)
Unsubscribes the client from the given channels, or from all of them if none is given.
bool|array
punsubscribe(string $pattern, string ...$other_patterns)
Unsubscribes the client from the given patterns, or from all of them if none is given.
mixed
evalsha(string $script_sha, array $args = [], int $num_keys = 0)
Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself.
In order to run this command Redis will have to have already loaded the script, either by running it or via the SCRIPT LOAD command.
bool|array
scan(null|int|string $iterator, string|array $key_or_address, string|null $pattern = null, int $count = 0)
Scan the keyspace for keys.
array|false
sscan(string $key, null|int|string $iterator, string|null $pattern = null, int $count = 0)
Scan a set for members.
RedisCluster|bool|array
zscan(string $key, null|int|string $iterator, string|null $pattern = null, int $count = 0)
Scan a sorted set for members, with optional pattern and count.
array|bool
hscan(string $key, null|int|string $iterator, string|null $pattern = null, int $count = 0)
Scan a HASH value for members, with an optional pattern and count.
int
getMode()
Detect whether we're in ATOMIC/MULTI/PIPELINE mode.
string|null
getLastError()
The last error message (if any)
bool
clearLastError()
Clear the last error message
mixed
getOption(int $option)
Get client option
bool
setOption(int $option, mixed $value)
Set client option.
bool|string
_prefix(string $key)
A utility method to prefix the key with the prefix setting for phpredis.
bool|string
_serialize(mixed $value)
A utility method to serialize values manually. This method allows you to serialize a value with whatever serializer is configured, manually. This can be useful for serialization/unserialization of data going in and out of EVAL commands as phpredis can't automatically do this itself. Note that if no serializer is set, phpredis will change Array values to 'Array', and Objects to 'Object'.
mixed
_unserialize(string $value)
A utility method to unserialize data with whatever serializer is set up. If there is no serializer set, the value will be returned unchanged. If there is a serializer set up, and the data passed in is malformed, an exception will be thrown. This can be useful if phpredis is serializing values, and you return something from redis in a LUA script that is serialized.
array
_masters()
Return all redis master nodes
RedisCluster|bool
multi(int $value = Redis::MULTI)
Enter and exit transactional mode.
array|false
exec()
No description
bool
discard()
No description
RedisCluster|bool
watch(string $key, string ...$other_keys)
Watches a key for modifications by another client. If the key is modified between WATCH and EXEC, the MULTI/EXEC transaction will fail (return FALSE). unwatch cancels all the watching of all keys by this client.
bool
unwatch()
No description
RedisCluster|bool
save(string|array $key_or_address)
Performs a synchronous save at a specific node.
RedisCluster|bool
bgSave(string|array $key_or_address)
Performs a background save at a specific node.
RedisCluster|bool
flushDB(string|array $key_or_address, bool $async = false)
Removes all entries from the current database at a specific node.
RedisCluster|bool
flushAll(string|array $key_or_address, bool $async = false)
Removes all entries from all databases at a specific node.
RedisCluster|int
dbSize(string|array $key_or_address)
Returns the current database's size at a specific node.
RedisCluster|bool
bgrewriteaof(string|array $key_or_address)
Starts the background rewrite of AOF (Append-Only File) at a specific node.
RedisCluster|int|false
lastSave(string|array $key_or_address)
Returns the timestamp of the last disk save at a specific node.
RedisCluster|array|false
info(string|array $key_or_address, string ...$sections)
Returns an associative array of strings and integers
mixed
role(string|array $key_or_address)
No description
RedisCluster|bool|string
randomKey(string|array $key_or_address)
Returns a random key at the specified node
RedisCluster|bool|array
time(string|array $key_or_address)
Return the specified node server time.
mixed
ping(string|array $key_or_address, string|null $message = null)
Check the specified node status
RedisCluster|string|false
echo(string|array $key_or_address, string $msg)
Returns message.
mixed
command(mixed ...$extra_args)
Returns Array reply of details about all Redis Cluster commands.
mixed
rawcommand(string|array $key_or_address, string $command, mixed ...$args)
Send arbitrary things to the redis server at the specified node
mixed
cluster(string|array $key_or_address, string $command, mixed ...$extra_args)
Executes cluster command
array|string|bool
client(string|array $key_or_address, string $subcommand, string|null $arg = null)
Allows you to get information of the cluster client
mixed
config(string|array $key_or_address, string $subcommand, mixed ...$extra_args)
Get or Set the redis config keys.
mixed
pubsub(string|array $key_or_address, string ...$values)
A command allowing you to get information on the Redis pub/sub system.
mixed
script(string|array $key_or_address, mixed ...$args)
Execute the Redis SCRIPT command to perform various operations on the scripting subsystem.
mixed
slowlog(string|array $key_or_address, mixed ...$args)
This function is used in order to read and reset the Redis slow queries log.
RedisCluster|int|false
geoadd(string $key, float $lng, float $lat, string $member, mixed ...$other_triples_and_options)
Add one or more geospatial items in the geospatial index represented using a sorted set
RedisCluster|array|false
geohash(string $key, string $member, string ...$other_members)
Returns members of a geospatial index as standard geohash strings
RedisCluster|array|false
geopos(string $key, string $member, string ...$other_members)
Returns longitude and latitude of members of a geospatial index
RedisCluster|float|false
geodist(string $key, string $src, string $dest, string|null $unit = null)
Returns the distance between two members of a geospatial index
mixed
georadius(string $key, float $lng, float $lat, float $radius, string $unit, array $options = [])
Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a point
mixed
georadiusbymember(string $key, string $member, float $radius, string $unit, array $options = [])
Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a member
string
_compress(string $value)
Compress a value with the currently configured compressor as set with RedisCluster::setOption().
string
_uncompress(string $value)
Uncompress the provided value with the currently configured compressor as set with RedisCluster::setOption().
string
_pack(mixed $value)
A utility method to pack a value with whatever serializer and compressor are configured.
string
_digest(mixed $value)
Compute the XXH3 digest of a PHP value after it has been _packed, producing
the same digest Redis' DIGEST command would return for the stored value.
mixed
_unpack(string $value)
A utility method to unpack a value that has been packed with the configured serializer and compressor.
string|null
_redir()
Return the last redirection that occurred while executing a command against the cluster.
mixed
acl(string|array $key_or_address, string $subcmd, string ...$args)
Execute the Redis ACL command on the given node.
RedisCluster|int|false
wait(string|array $key_or_address, int $numreplicas, int $timeout)
Block the client up to the provided timeout until a certain number of replicas have confirmed receiving the write operations.
RedisCluster|array|false
waitaof(string|array $key_or_address, int $numlocal, int $numreplicas, int $timeout)
Block the client until all previous write and AOF operations have been persisted to disk on the given number of local and replica AOFs.
RedisCluster|string|false
lMove(string $src, string $dst, string $wherefrom, string $whereto)
Move an element from one list into another.
RedisCluster|array|false
lmovem(string $src, string $dst, string $wherefrom, string $whereto, array|null $options = null)
Move one or more element from one list to another.
RedisCluster|string|false
blmove(string $src, string $dst, string $wherefrom, string $whereto, float $timeout)
Move an element from one list to another, blocking up to a timeout until an element is available.
RedisCluster|array|false
blmovem(string $src, string $dst, string $wherefrom, string $whereto, float $timeout, array|null $options = null)
Move one or more element from one list to another, blocking up to a timeout until an element is available.
array
bzPopMax(string|array $key, string|int $timeout_or_key, mixed ...$extra_args)
Pop the highest scoring member(s) from one or more sorted sets, blocking until one is available.
array
bzPopMin(string|array $key, string|int $timeout_or_key, mixed ...$extra_args)
Pop the lowest scoring member(s) from one or more sorted sets, blocking until one is available.
RedisCluster|array|null|false
bzmpop(float $timeout, array $keys, string $from, int $count = 1)
Pop one or more of the highest or lowest scoring members from one or more sorted sets, blocking up to the given timeout until an element is available.
RedisCluster|array|null|false
zmpop(array $keys, string $from, int $count = 1)
Pop one or more of the highest or lowest scoring members from one or more sorted sets.
RedisCluster|array|null|false
blmpop(float $timeout, array $keys, string $from, int $count = 1)
Pop one or more elements from the first non-empty list, blocking up to the given timeout until an element is available.
RedisCluster|array|null|false
lmpop(array $keys, string $from, int $count = 1)
Pop one or more elements from the first non-empty list.
RedisCluster|bool
copy(string $src, string $dst, array|null $options = null)
Copy a key to another key. Note that in a cluster both keys must map to the same slot.
RedisCluster|int|false
delex(string $key, array|null $options = null)
Delete a key conditionally based on its value or hash digest.
RedisCluster|int|false
delifeq(string $key, mixed $value)
Delete a key if it's equal to the specified value. This command is specific to Valkey >= 9.0.
RedisCluster|int|false
msetex(array $key_vals, int|float|array|null $expiry = null)
Set one or more keys and values with optional expiry information.
float
decrbyfloat(string $key, float $value)
Decrement a floating point value stored at a key by the provided amount.
mixed
eval(string $script, array $args = [], int $num_keys = 0)
Evaluate a LUA script on the redis server.
mixed
eval_ro(string $script, array $args = [], int $num_keys = 0)
A read-only variant of EVAL that can be run against a replica.
mixed
evalsha_ro(string $script_sha, array $args = [], int $num_keys = 0)
A read-only variant of EVALSHA that can be run against a replica.
RedisCluster|int|bool
touch(mixed $key, mixed ...$other_keys)
Update one or more keys last modified metadata.
RedisCluster|int|false
expiretime(string $key)
Get the expiration of a key as a unix timestamp in seconds.
RedisCluster|int|false
pexpiretime(string $key)
Get the expiration of a key as a unix timestamp in milliseconds.
mixed
georadius_ro(string $key, float $lng, float $lat, float $radius, string $unit, array $options = [])
A read-only variant of GEORADIUS that can be run against a replica.
mixed
georadiusbymember_ro(string $key, string $member, float $radius, string $unit, array $options = [])
A read-only variant of GEORADIUSBYMEMBER that can be run against a replica.
RedisCluster|array
geosearch(string $key, array|string $position, array|int|float $shape, string $unit, array $options = [])
Search a geospatial index for members inside an area of a box or circle.
RedisCluster|array|int|false
geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = [])
Search a geospatial index for members inside an area of a box or circle, storing the result in a new set.
mixed
getDel(string $key)
Get the value of a key and delete it in one atomic operation.
RedisCluster|array|false
getWithMeta(string $key)
Retrieve a value and metadata of a key.
RedisCluster|string|false
getEx(string $key, array $options = [])
Get the value of a key and optionally set its expiration in one atomic operation.
RedisCluster|string|array|int|false
lcs(string $key1, string $key2, array|null $options = null)
Find the longest common subsequence between two string keys. Note that both keys must map to the same slot.
array|false
getTransferredBytes()
Retrieve the number of bytes sent and received on the connection.
void
clearTransferredBytes()
Reset the transferred bytes counters for the connection.
RedisCluster|int|false
expiremember(string $key, string $field, int $ttl, string|null $unit = null)
Set an expiration on a specific hash field. This command is specific to KeyDB/Valkey.
RedisCluster|int|false
expirememberat(string $key, string $field, int $timestamp)
Set the expiration of a specific hash field to a unix timestamp. This command is specific to KeyDB/Valkey.
RedisCluster|string|array
hRandField(string $key, array|null $options = null)
Get one or more random fields from a hash.
RedisCluster|int|false
hStrLen(string $key, string $field)
Get the string length of a hash field's value.
mixed
hgetWithMeta(string $key, string $member)
Retrieve a value and metadata of a hash field.
RedisCluster|array|false
hgetex(string $key, array $fields, string|array|null $expiry = null)
Get one or more fields from a hash with optional expiration information.
RedisCluster|int|false
hsetex(string $key, array $fields, array|null $expiry = null)
Set one or more fields in a hash with optional expiration information.
RedisCluster|array|false
hgetdel(string $key, array $fields)
Get one or more fields from a hash and delete them.
RedisCluster|array|false
hexpire(string $key, int $ttl, array $fields, string|null $mode = null)
Set an expiration (in seconds) on one or more fields of a hash.
RedisCluster|array|false
hpexpire(string $key, int $ttl, array $fields, string|null $mode = null)
Set an expiration (in milliseconds) on one or more fields of a hash.
RedisCluster|array|false
hexpireat(string $key, int $time, array $fields, string|null $mode = null)
Set the expiration of one or more fields of a hash to a unix timestamp in seconds.
RedisCluster|array|false
hpexpireat(string $key, int $mstime, array $fields, string|null $mode = null)
Set the expiration of one or more fields of a hash to a unix timestamp in milliseconds.
RedisCluster|array|false
httl(string $key, array $fields)
Get the remaining time to live (in seconds) of one or more fields of a hash.
RedisCluster|array|false
hpttl(string $key, array $fields)
Get the remaining time to live (in milliseconds) of one or more fields of a hash.
RedisCluster|array|false
hexpiretime(string $key, array $fields)
Get the expiration of one or more fields of a hash as a unix timestamp in seconds.
RedisCluster|array|false
hpexpiretime(string $key, array $fields)
Get the expiration of one or more fields of a hash as a unix timestamp in milliseconds.
RedisCluster|array|false
hpersist(string $key, array $fields)
Remove the expiration from one or more fields of a hash.
RedisCluster|null|bool|int|array
lPos(string $key, mixed $value, array|null $options = null)
Get the position(s) of an element in a list.
RedisCluster|int|false
sintercard(array $keys, int $limit = -1)
Compute the intersection of one or more sets and return the cardinality of the result.
RedisCluster|int|false
sunioncard(array $keys, array|null $options = null)
Compute the union of one or more sets and return the cardinality of the result.
RedisCluster|int|false
sdiffcard(array $keys, array|null $options = null)
Compute the difference of one or more sets and return the cardinality of the result.
RedisCluster|array|false
sMisMember(string $key, string $member, string ...$other_members)
Check whether one or more values are members of a set.
RedisCluster|array|bool|int|string
sort_ro(string $key, array|null $options = null)
A read-only variant of SORT that can be run against a replica.
RedisCluster|int|false
unlink(array|string $key, string ...$other_keys)
Delete one or more keys from the cluster without blocking, reclaiming memory in a background thread.
RedisCluster|int|false
xack(string $key, string $group, array $ids)
Acknowledge one or more pending messages that were consumed with XREADGROUP.
RedisCluster|string|false
xadd(string $key, string $id, array $values, int $maxlen = 0, bool $approx = false)
Append a new message to a stream.
RedisCluster|string|array|false
xclaim(string $key, string $group, string $consumer, int $min_iddle, array $ids, array $options)
Claim ownership of one or more pending stream messages for a given consumer.
RedisCluster|int|false
xdel(string $key, array $ids)
Remove one or more messages from a stream.
RedisCluster|array|false
xdelex(string $key, array $ids, string|null $mode = null)
Remove one or more IDs from a stream with extended options.
mixed
xgroup(string $operation, string|null $key = null, string|null $group = null, string|null $id_or_consumer = null, bool $mkstream = false, int $entries_read = -2)
Perform various operations on consumer groups for a particular stream.
RedisCluster|bool|array
xautoclaim(string $key, string $group, string $consumer, int $min_idle, string $start, int $count = -1, bool $justid = false)
Automatically claim and transfer ownership of pending messages that have been idle for a given time.
mixed
xinfo(string $operation, string|null $arg1 = null, string|null $arg2 = null, int $count = -1)
Retrieve information about a stream, its consumer groups, or its consumers.
RedisCluster|int|false
xlen(string $key)
Get the number of messages in a stream.
RedisCluster|array|false
xpending(string $key, string $group, string|null $start = null, string|null $end = null, int $count = -1, string|null $consumer = null)
Retrieve information about pending messages in a consumer group.
RedisCluster|bool|array
xrange(string $key, string $start, string $end, int $count = -1)
Get a range of messages from a stream in chronological order.
RedisCluster|bool|array
xread(array $streams, int $count = -1, int $block = -1)
Read messages from one or more streams.
RedisCluster|bool|array
xreadgroup(string $group, string $consumer, array $streams, int $count = 1, int $block = 1)
Read messages from one or more streams as part of a consumer group.
RedisCluster|bool|array
xrevrange(string $key, string $start, string $end, int $count = -1)
Get a range of messages from a stream in reverse chronological order.
RedisCluster|int|false
xtrim(string $key, int $maxlen, bool $approx = false, bool $minid = false, int $limit = -1)
Truncate a stream to a given maximum length or minimum ID.
RedisCluster|int|false
zintercard(array $keys, int $limit = -1)
Compute the intersection of one or more sorted sets and return the cardinality of the result.
RedisCluster|bool|array
zPopMax(string $key, int|null $value = null)
Pop one or more of the highest scoring members from a sorted set.
RedisCluster|bool|array
zPopMin(string $key, int|null $value = null)
Pop one or more of the lowest scoring members from a sorted set.
RedisCluster|int|false
zrangestore(string $dstkey, string $srckey, int $start, int $end, array|bool|null $options = null)
Store a range of a sorted set into a new sorted set. Note that both keys must map to the same slot.
RedisCluster|string|array
zRandMember(string $key, array|null $options = null)
Get one or more random members from a sorted set.
RedisCluster|array|false
zMscore(string $key, mixed $member, mixed ...$other_members)
Get the scores of one or more members in a sorted set.
RedisCluster|array|false
zinter(array $keys, array|null $weights = null, array|null $options = null)
Compute the intersection of one or more sorted sets and return the result.
RedisCluster|int|false
zdiffstore(string $dst, array $keys)
Compute the difference of one or more sorted sets and store the result in a new sorted set.
RedisCluster|array|false
zunion(array $keys, array|null $weights = null, array|null $options = null)
Compute the union of one or more sorted sets and return the result.
RedisCluster|array|false
zdiff(array $keys, array|null $options = null)
Compute the difference of one or more sorted sets and return the result.
RedisCluster|int|false
vadd(string $key, array $values, mixed $element, array|null $options = null)
Add an element to a vector set.
RedisCluster|array|false
vsim(string $key, mixed $member, array|null $options = null)
Query similarity of a vector by element or scores.
RedisCluster|int|false
vcard(string $key)
Get the number of elements in a vector set.
RedisCluster|int|false
vdim(string $key)
Get the number of dimensions in a vector set.
RedisCluster|array|false
vinfo(string $key)
Get various bits of information about a vector set.
RedisCluster|bool
vismember(string $key, mixed $member)
Check if an element is a member of a vector set.
RedisCluster|array|false
vemb(string $key, mixed $member, bool $raw = false)
Get the embeddings for a specific member of a vector set.
RedisCluster|array|string|false
vrandmember(string $key, int $count = 0)
Get one or more random members from a vector set.
RedisCluster|array|false
vrange(string $key, string $min, string $max, int $count = -1)
Retrieve a lexicographical range of elements from a vector set.
RedisCluster|int|false
vrem(string $key, mixed $member)
Remove an element from a vector set.
RedisCluster|array|false
vlinks(string $key, mixed $member, bool $withscores = false)
Get any adjacent values for a member of a vector set.
RedisCluster|array|string|false
vgetattr(string $key, mixed $member, bool $decode = true)
Get the attributes of a vector set element.
RedisCluster|int|false
vsetattr(string $key, mixed $member, array|string $attributes)
Set the attributes of a vector set element.
RedisCluster|array|false
gcra(string $key, int $maxBurst, int $requestsPerPeriod, int $period, int $tokens = 0)
Get rate limiting information for a key using the GCRA (Generic Cell Rate Algorithm).
RedisCluster|string|false
digest(string $key)
Ask the server for the XXH3 digest of a given key's value.