Package io.quarkus.redis.datasource.hash
Interface ReactiveHashCommands<K,F,V>
- Type Parameters:
K
- the type of the keyF
- the type of the fieldV
- the type of the value
- All Superinterfaces:
ReactiveRedisCommands
- All Known Implementing Classes:
ReactiveHashCommandsImpl
Allows executing commands from the
hash
group.
See the hash command list for further information about these commands.
A hash
is a like a Map<F, V>
.
This group is parameterized by the type of the key Map<K>
. This is the type of the key in which the hash is
stored.
<F>
is the type of the key in the map (field). The stored value are of type Map<V>
-
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<Integer>
Execute the command HDEL.io.smallrye.mutiny.Uni<Boolean>
Execute the command HEXISTS.io.smallrye.mutiny.Uni<V>
Execute the command HGET.Execute the command HGETALL.io.smallrye.mutiny.Uni<Long>
Execute the command HINCRBY.io.smallrye.mutiny.Uni<Double>
hincrbyfloat
(K key, F field, double amount) Execute the command HINCRBYFLOAT.Execute the command HKEYS.io.smallrye.mutiny.Uni<Long>
Execute the command HLEN.Execute the command HMGET.io.smallrye.mutiny.Uni<Void>
Deprecated.io.smallrye.mutiny.Uni<F>
hrandfield
(K key) Execute the command HRANDFIELD.hrandfield
(K key, long count) Execute the command HRANDFIELD.hrandfieldWithValues
(K key, long count) Execute the command HRANDFIELD.Execute the command HSCAN.Execute the command HSCAN.io.smallrye.mutiny.Uni<Boolean>
Execute the command HSET.io.smallrye.mutiny.Uni<Long>
Execute the command HSET.io.smallrye.mutiny.Uni<Boolean>
Execute the command HSETNX.io.smallrye.mutiny.Uni<Long>
Execute the command HSTRLEN.Execute the command HVALS.Methods inherited from interface io.quarkus.redis.datasource.ReactiveRedisCommands
getDataSource
-
Method Details
-
hdel
Execute the command HDEL. Summary: Delete one or more hash fields Group: hash Requires Redis 2.0.0- Parameters:
key
- the key- Returns:
- the number of fields that were removed from the hash, not including specified but non-existing fields.
-
hexists
Execute the command HEXISTS. Summary: Determine if a hash field exists Group: hash Requires Redis 2.0.0- Parameters:
key
- the keyfield
- the value- Returns:
true
the hash contains field.false
the hash does not contain field, or the key does not exist.
-
hget
Execute the command HGET. Summary: Get the value of a hash field Group: hash Requires Redis 2.0.0- Parameters:
key
- the keyfield
- the value- Returns:
- the value associated with
field
, ornull
whenfield
is not present in the hash or the key does not exist.
-
hincrby
Execute the command HINCRBY. Summary: Increment the integer value of a hash field by the given number Group: hash Requires Redis 2.0.0- Parameters:
key
- the keyfield
- the value- Returns:
- the value at field after the increment operation.
-
hincrbyfloat
Execute the command HINCRBYFLOAT. Summary: Increment the float value of a hash field by the given amount Group: hash Requires Redis 2.6.0- Parameters:
key
- the keyfield
- the value- Returns:
- the value of field after the increment.
-
hgetall
Execute the command HGETALL. Summary: Get all the fields and values in a hash Group: hash Requires Redis 2.0.0- Parameters:
key
- the key- Returns:
- the map fields -> values stored in the hash, or an empty map when
key
does not exist.
-
hkeys
Execute the command HKEYS. Summary: Get all the fields in a hash Group: hash Requires Redis 2.0.0- Parameters:
key
- the key- Returns:
- list of fields in the hash, or an empty list when key does not exist.
-
hlen
Execute the command HLEN. Summary: Get the number of fields in a hash Group: hash Requires Redis 2.0.0- Parameters:
key
- the key- Returns:
- number of fields in the hash, or 0 when key does not exist.
-
hmget
Execute the command HMGET. Summary: Get the values of all the given hash fields Group: hash Requires Redis 2.0.0- Parameters:
key
- the keyfields
- the fields- Returns:
- list of values associated with the given fields, in the same order as they are requested.
If a requested field does not exist, the returned map contains a
null
value for that field.
-
hmset
Deprecated.Usehset(Object, Map)
with multiple field-value pairs.Execute the command HMSET. Summary: Set multiple hash fields to multiple values Group: hash Requires Redis 2.0.0- Parameters:
key
- the keymap
- the key/value map to set- Returns:
- a Uni completed with
null
when the operation completes
-
hrandfield
Execute the command HRANDFIELD. Summary: Get one or multiple random fields from a hash Group: hash Requires Redis 6.2.0- Parameters:
key
- the key- Returns:
- a random key from the hash,
null
if the key does not exist
-
hrandfield
Execute the command HRANDFIELD. Summary: Get one or multiple random fields from a hash Group: hash Requires Redis 6.2.0- Parameters:
key
- the keycount
- the number of random key to retrieve. Ifcount
is positive, the selected keys are distinct. Ifcount
is negative, the produced list can contain duplicated keys.- Returns:
- the list of keys, empty if the key does not exist
-
hrandfieldWithValues
Execute the command HRANDFIELD. Summary: Get one or multiple random fields and the associated values from a hash Group: hash Requires Redis 6.2.0- Parameters:
key
- the keycount
- the number of random key to retrieve. Ifcount
is positive, the selected keys are distinct. Ifcount
is negative, the produced list can contain duplicated keys. These duplicates are not included in the producedMap
.- Returns:
- the map containing the random keys and the associated values,
empty
if the key does not exist
-
hscan
Execute the command HSCAN. Summary: Incrementally iterate hash fields and associated values Group: hash Requires Redis 2.8.0- Parameters:
key
- the key- Returns:
- the cursor.
-
hscan
Execute the command HSCAN. Summary: Incrementally iterate hash fields and associated values Group: hash Requires Redis 2.8.0- Parameters:
key
- the keyscanArgs
- the additional argument- Returns:
- the cursor
-
hset
Execute the command HSET. Summary: Set the string value of a hash field Group: hash Requires Redis 2.0.0- Parameters:
key
- the keyfield
- the fieldvalue
- the value- Returns:
true
if the value was set
-
hset
Execute the command HSET. Summary: Set the string value of a hash field Group: hash Requires Redis 2.0.0- Parameters:
key
- the keymap
- the set of key -> value to add to the hash- Returns:
- the number of fields that were added.
-
hsetnx
Execute the command HSETNX. Summary: Set the value of a hash field, only if the field does not exist Group: hash Requires Redis 2.0.0- Parameters:
key
- the keyfield
- the valuevalue
- the value- Returns:
true
field is a new field in the hash and value was set.false
field already exists in the hash and no operation was performed.
-
hstrlen
Execute the command HSTRLEN. Summary: Get the length of the value of a hash field Group: hash Requires Redis 3.2.0- Parameters:
key
- the keyfield
- the value- Returns:
- the string length of the value associated with
field
, or zero whenfield
is not present in the hash or key does not exist at all.
-
hvals
Execute the command HVALS. Summary: Get all the values in a hash Group: hash Requires Redis 2.0.0- Parameters:
key
- the key- Returns:
- list of values in the hash, or an empty list when key does not exist.
-
hset(Object, Map)
with multiple field-value pairs.