trait HashCommands extends AnyRef
This trait implements hash commands.
- Self Type
- HashCommands with Connection with NonBlockingConnection
- Alphabetic
- By Inheritance
- HashCommands
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hDel(key: String, fields: String*): Future[Long]
Deletes one or more hash fields.
Deletes one or more hash fields.
- key
key of the hash
- fields
field(s) to be deleted from hash
- returns
the number of fields that were removed from the hash, not including specified but non existing fields
- Since
2.0.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash- Note
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.
-
def
hExists(key: String, field: String): Future[Boolean]
Determines if a hash field exists.
Determines if a hash field exists.
- key
hash key
- field
name of the field
- returns
true if the hash contains field, false if the hash does not contain it or the key does not exists
- Since
2.0.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash
-
def
hGet[R](key: String, field: String)(implicit arg0: Reader[R]): Future[Option[R]]
Returns the value of a hash field.
Returns the value of a hash field.
- key
hash key
- field
field name to retrieve
- returns
the value associated with field name, or
None
when field is not present in the hash or key does not exist
- Since
2.0.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash
-
def
hGetAll[R](key: String)(implicit arg0: Reader[R]): Future[Option[Map[String, R]]]
Returns all the fields and values in a hash.
Returns all the fields and values in a hash.
- key
hash key
- returns
key-value pairs stored in hash with key, or
None
when hash is empty or key does not exist
- Since
2.0.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash
-
def
hIncrBy(key: String, field: String, count: Long): Future[Long]
Increments the integer value of a hash field by the given number.
Increments the integer value of a hash field by the given number.
- key
hash key
- field
field name to increment
- count
increment
- returns
the value at field after the increment operation
- Since
2.0.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if the field does not hold an integer value or if the value stored at key is not of type hash- Note
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.
-
def
hIncrByFloat(key: String, field: String, count: Double): Future[Double]
Increments the float value of a hash field by the given amount.
Increments the float value of a hash field by the given amount.
- key
hash key
- field
field name to increment
- count
increment
- returns
the value at field after the increment operation
- Since
2.6.0
- Exceptions thrown
[[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- Note
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.
-
def
hKeys(key: String): Future[Set[String]]
Returns all the fields in a hash.
Returns all the fields in a hash.
- key
hash key
- returns
set of field names or the empty set if the hash is empty or the key does not exist
- Since
2.0.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash
-
def
hLen(key: String): Future[Long]
Returns the number of fields contained in the hash stored at key.
Returns the number of fields contained in the hash stored at key.
- key
hash key
- returns
number of fields in the hash, or 0 if the key does not exist
- Since
2.0.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash
-
def
hScan[R](key: String, cursor: Long, matchOpt: Option[String] = None, countOpt: Option[Int] = None)(implicit arg0: Reader[R]): Future[(Long, List[(String, R)])]
Incrementally iterates through the fields of a hash.
Incrementally iterates through the fields of a hash.
- cursor
the offset
- matchOpt
when defined, the command only returns elements matching the pattern
- countOpt
when defined, provides a hint of how many elements should be returned
- returns
a pair containing the next cursor as its first element and the list of fields (key-value pairs) as its second element
- Since
2.8.0
-
def
hSet[W](key: String, field: String, value: W)(implicit arg0: Writer[W]): Future[Boolean]
Sets the string value of a hash field.
Sets the string value of a hash field.
- key
hash key
- field
field name to set
- value
value to set
- returns
true if field is a new field in the hash and value was set, false if field already exists and the value was updated
- Since
2.0.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash- Note
If the field already exists in the hash, it is overwritten.
-
def
hSetNX[W](key: String, field: String, value: W)(implicit arg0: Writer[W]): Future[Boolean]
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.
- key
hash key
- field
field name to set
- value
value to set
- returns
true if field is a new field in the hash and value was set, false if field already exists and no operation was performed
- Since
2.0.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash
-
def
hVals[R](key: String)(implicit arg0: Reader[R]): Future[List[R]]
Returns all the values in a hash.
Returns all the values in a hash.
- key
hash key
- returns
list of values, or the empty list if hash is empty or key does not exist
- Since
2.0.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
hmGet[R](key: String, fields: String*)(implicit arg0: Reader[R]): Future[List[Option[R]]]
Returns the values associated to the specified hash fields.
Returns the values associated to the specified hash fields.
- key
hash key
- fields
field(s) to retrieve
- returns
list of value(s) associated to the specified field name(s)
- Since
2.0.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash- Note
For every field that does not exist,
None
is returned.
-
def
hmGetAsMap[R](key: String, fields: String*)(implicit arg0: Reader[R]): Future[Map[String, R]]
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.- key
hash key
- fields
field(s) to retrieve
- returns
field-value pairs associated to the specified field name(s)
- Since
2.0.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash- Note
Every non-existent field gets removed from the resulting
Map
.
-
def
hmSet[W](key: String, fieldValuePairs: Map[String, W])(implicit arg0: Writer[W]): Future[Unit]
Sets multiple hash fields to multiple values.
Sets multiple hash fields to multiple values.
- key
hash key
- fieldValuePairs
field-value pair(s) to be set
- Since
2.0.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if the value stored at key is not of type hash- Note
This command overwrites any existing fields in the hash. If key does not exist, a new key holding a hash is created
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )