t

scredis.commands

HashCommands

trait HashCommands extends AnyRef

This trait implements hash commands.

Self Type
HashCommands with Connection with NonBlockingConnection
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HashCommands
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. 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.

  11. 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

  12. 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

  13. 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

  14. 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.

  15. 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.

  16. 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

  17. 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

  18. 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

  19. 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.

  20. 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

  21. def hStrlen(key: String, field: String): Future[Long]

    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.

    key

    hash key

    field

    field name to set

    returns

    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.

  22. 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

  23. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  24. 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.

  25. 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.

  26. 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

  27. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  28. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  29. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  30. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  31. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  32. def toString(): String
    Definition Classes
    AnyRef → Any
  33. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  34. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  35. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped