RespCommandsTier2 class
Easy to use API for the Redis commands.
Constructors
- RespCommandsTier2(RespClient client)
- RespCommandsTier2.tier0(RespCommandsTier0 tier0)
- RespCommandsTier2.tier1(RespCommandsTier1 tier1)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tier1 → RespCommandsTier1
-
final
Methods
-
auth(
String password) → Future< bool> - Sends the authentication password to the server. Returns true, if the password matches, otherwise false.
-
blpop(
List< String> keys, int timeout) → Future<List< String?> > - See https://redis.io/commands/blpop
-
brpop(
List< String> keys, int timeout) → Future<List< String?> > - 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.
-
brpoplpush(
String source, String destination, int timeout) → Future< String?> - BRPOPLPUSH is the blocking variant of RPOPLPUSH. When source contains elements, this command behaves exactly like RPOPLPUSH. When used inside a MULTI/EXEC block, this command behaves exactly like RPOPLPUSH. When source is empty, Redis will block the connection until another client pushes to it or until timeout is reached. A timeout of zero can be used to block indefinitely.
-
clientList(
) → Future< List< String> > - Returns a list of connected clients.
-
dbsize(
) → Future< int> - Return the number of keys in the currently-selected database.
-
decr(
String key) → Future< int> - Decrements the number stored at key by one. If the key does not exist, it is set to 0 before performing the operation. An error is returned if the key contains a value of the wrong type or contains a string that can not be represented as integer. This operation is limited to 64 bit signed integers.
-
decrby(
String key, int decrement) → Future< int> - Decrements the number stored at key by decrement. If the key does not exist, it is set to 0 before performing the operation. An error is returned if the key contains a value of the wrong type or contains a string that can not be represented as integer. This operation is limited to 64 bit signed integers.
-
del(
List< String> keys) → Future<int> -
Removes the value for the given
keys
. Returns the number of deleted values. -
discard(
) → Future< bool> -
exec(
) → Future< RespArray> -
exists(
List< String> keys) → Future<int> -
Returns the number of values exists for the given
keys
-
flushAll(
{bool? doAsync}) → Future< void> - Flushes all databases. Completes with no value, if the command was successful.
-
flushDb(
{bool? doAsync}) → Future< void> - Flushes the currently selected database. Completes with no value, if the command was successful.
-
get(
String key) → Future< String?> -
Returns the value for the given
key
. If no value if present for the key,null
is returned. -
hdel(
String key, List< String> fields) → Future<int> - Removes the specified fields from the hash stored at key. Specified fields that do not exist within this hash are ignored. If key does not exist, it is treated as an empty hash and this command returns 0.
-
hexists(
String key, String field) → Future< bool> - Returns if field is an existing field in the hash stored at key.
-
hget(
String key, String field) → Future< String?> - Returns the value associated with field in the hash stored at key.
-
hgetall(
String key) → Future< Map< String, String?> > - Returns all fields and values of the hash stored at key. In the returned value, every field name is followed by its value, so the length of the reply is twice the size of the hash.
-
hkeys(
String key) → Future< List< String> > - Returns all field names in the hash stored at key.
-
hmget(
String key, List< String> fields) → Future<Map< String, String?> > - Returns the values associated with the specified fields in the hash stored at key.
-
hmset(
String key, Map< String, String> keysAndValues) → Future<void> - Sets the specified fields to their respective values in the hash stored at key. This command overwrites any specified fields already existing in the hash. If key does not exist, a new key holding a hash is created.
-
hset(
String key, String field, Object value) → Future< bool> - Sets field in the hash stored at key to value. If key does not exist, a new key holding a hash is created. If field already exists in the hash, it is overwritten.
-
hsetnx(
String key, String field, Object value) → Future< bool> - Sets field in the hash stored at key to value, only if field does not yet exist. If key does not exist, a new key holding a hash is created. If field already exists, this operation has no effect.
-
hvals(
String key) → Future< List< String?> > - Returns all values in the hash stored at key.
-
incr(
String key) → Future< int> - Increments the number stored at key by one. If the key does not exist, it is set to 0 before performing the operation. An error is returned if the key contains a value of the wrong type or contains a string that can not be represented as integer. This operation is limited to 64 bit signed integers.
-
incrby(
String key, int increment) → Future< int> - Increments the number stored at key by increment. If the key does not exist, it is set to 0 before performing the operation. An error is returned if the key contains a value of the wrong type or contains a string that can not be represented as integer. This operation is limited to 64 bit signed integers.
-
info(
[String? section]) → Future< String?> - The INFO command returns information and statistics about the server in a format that is simple to parse by computers and easy to read by humans.
-
lindex(
String key, int index) → Future< String?> - Returns the element at index index in the list stored at key. The index is zero-based, so 0 means the first element, 1 the second element and so on. Negative indices can be used to designate elements starting at the tail of the list. Here, -1 means the last element, -2 means the penultimate and so forth.
-
linsert(
String key, InsertMode insertMode, Object pivot, Object value) → Future< int> - Inserts value in the list stored at key either before or after the reference value pivot.
-
llen(
String key) → Future< int> - Returns the length of the list stored at key. If key does not exist, it is interpreted as an empty list and 0 is returned. An error is returned when the value stored at key is not a list.
-
lpop(
String key) → Future< String?> - Removes and returns the first element of the list stored at key.
-
lpush(
String key, List< Object> values) → Future<int> - Insert all the specified values at the head of the list stored at key. If key does not exist, it is created as empty list before performing the push operations. When key holds a value that is not a list, an error is returned.
-
lpushx(
String key, List< Object> values) → Future<int> - Inserts value at the head of the list stored at key, only if key already exists and holds a list. In contrary to LPUSH, no operation will be performed when key does not yet exist.
-
lrange(
String key, int start, int stop) → Future< List< String?> > - Returns the specified elements of the list stored at key. The offsets start and stop are zero-based indexes, with 0 being the first element of the list (the head of the list), 1 being the next element and so on.
-
lrem(
String key, int count, Object value) → Future< int> - Time complexity: O(N) where N is the length of the list.
-
lset(
String key, int index, Object value) → Future< bool> - Sets the list element at index to value. For more information on the index argument, see LINDEX.
-
ltrim(
String key, int start, int stop) → Future< void> - Trim an existing list so that it will contain only the specified range of elements specified. Both start and stop are zero-based indexes, where 0 is the first element of the list (the head), 1 the next element and so on.
-
multi(
) → Future< bool> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pexpire(
String key, Duration timeout) → Future< bool> -
Sets the timeout for the given
key
. Returnstrue
, if the timeout was successfully set. Otherwise,false
is returned. -
publish(
String channel, Object message) → Future< int> - Posts a message to the given channel.
-
rpop(
String key) → Future< String?> - Removes and returns the last element of the list stored at key.
-
rpoplpush(
String source, String destination) → Future< String?> - Atomically returns and removes the last element (tail) of the list stored at source, and pushes the element at the first element (head) of the list stored at destination.
-
rpush(
String key, List< Object> values) → Future<int> - Insert all the specified values at the tail of the list stored at key. If key does not exist, it is created as empty list before performing the push operation. When key holds a value that is not a list, an error is returned.
-
rpushx(
String key, List< Object> values) → Future<int> - Inserts value at the tail of the list stored at key, only if key already exists and holds a list. In contrary to RPUSH, no operation will be performed when key does not yet exist.
-
scan(
int cursor, {String? pattern, int? count}) → Future< ScanResult> - The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.
-
select(
int index) → Future< void> - Selects the Redis logical database. Completes with no value, if the command was successful.
-
set(
String key, Object value, {ExpireMode? expire, SetMode? mode, bool get = false}) → Future< SetResult> - Sets a value for the given key.
-
subscribe(
List< String> channels) → Future<void> - Subscribes the client to the specified channels.
-
toString(
) → String -
A string representation of this object.
inherited
-
ttl(
String key) → Future< int> -
Return the ttl of the given
key
in seconds. Returns-1
, if the key has no ttl. Returns-2
, if the key does not exists. -
unsubscribe(
Iterable< String> channels) → Future<void> - Unsubscribes the client from the given channels, or from all of them if none is given.
-
unwatch(
) → Future< bool> -
watch(
List< String> keys) → Future<bool>
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited