Deletes one or more hash fields.
Deletes one or more hash fields.
key of the hash
field(s) to be deleted from hash
the number of fields that were removed from the hash, not including specified but non existing fields
2.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash
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. Redis versions older than 2.4 can only remove a field per call.
Determines if a hash field exists.
Determines if a hash field exists.
hash key
name of the field
true if the hash contains field, false if the hash does not contain it or the key does not exists
2.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash
Returns the value of a hash field.
Returns the value of a hash field.
hash key
field name to retrieve
the value associated with field name, or None
when field is not present in the hash
or key does not exist
2.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash
Returns all the fields and values in a hash.
Returns all the fields and values in a hash.
hash key
key-value pairs stored in hash with key, or None
when hash is empty or key does not
exist
2.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash
Increments the integer value of a hash field by the given number.
Increments the integer value of a hash field by the given number.
hash key
field name to increment
increment
the value at field after the increment operation
2.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if the field does not hold an integer value or if the value stored at key is not of
type hash
If key does not exist, a new key holding a hash is created. If field does not exist the value is set to 0 before the operation is performed.
Increments the float value of a hash field by the given amount.
Increments the float value of a hash field by the given amount.
hash key
field name to increment
increment
the value at field after the increment operation
2.6.0
[[scredis.exceptions.RedisErrorResponseException]]
if the field does not hold a floating point value or if the value stored at key is
not of type hash
If key does not exist, a new key holding a hash is created. If field does not exist the value is set to 0 before the operation is performed.
Returns all the fields in a hash.
Returns all the fields in a hash.
hash key
set of field names or the empty set if the hash is empty or the key does not exist
2.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash
Returns the number of fields contained in the hash stored at key.
Returns the number of fields contained in the hash stored at key.
hash key
number of fields in the hash, or 0 if the key does not exist
2.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash
Incrementally iterates through the fields of a hash.
Incrementally iterates through the fields of a hash.
the offset
when defined, the command only returns elements matching the pattern
when defined, provides a hint of how many elements should be returned
a pair containing the next cursor as its first element and the list of fields (key-value pairs) as its second element
2.8.0
Sets the string value of a hash field.
Sets the string value of a hash field.
hash key
field name to set
value to set
true if field is a new field in the hash and value was set, false if field already exists and the value was updated
2.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash
If the field already exists in the hash, it is overwritten.
Sets the value of a hash field, only if the field does not exist.
Sets the value of a hash field, only if the field does not exist.
hash key
field name to set
value to set
true if field is a new field in the hash and value was set, false if field already exists and no operation was performed
2.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash
Returns the length of the value associated with field in the hash stored at key.
Returns the length of the value associated with field in the hash stored at key. For numbers it is a count of their digits (+1 if number is negative) For booleans it is true=4 and false=5 For strings it is number of bytes they occupy. ONLY if you don't use utf characters it will be their length. If the key or the field do not exist, 0 is returned.
hash key
field name to set
the string length of the value associated with field, or zero when field is not present in the hash or key does not exist at all.
Returns all the values in a hash.
Returns all the values in a hash.
hash key
list of values, or the empty list if hash is empty or key does not exist
2.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash
Returns the values associated to the specified hash fields.
Returns the values associated to the specified hash fields.
hash key
field(s) to retrieve
list of value(s) associated to the specified field name(s)
2.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash
For every field that does not exist, None
is returned.
Returns a Map
containing field-value pairs associated to the specified hash fields.
Returns a Map
containing field-value pairs associated to the specified hash fields.
hash key
field(s) to retrieve
field-value pairs associated to the specified field name(s)
2.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash
Every non-existent field gets removed from the resulting Map
.
Sets multiple hash fields to multiple values.
Sets multiple hash fields to multiple values.
hash key
field-value pair(s) to be set
2.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash
This command overwrites any existing fields in the hash. If key does not exist, a new key holding a hash is created
This trait implements hash commands.