trait ListCommands extends AnyRef
This trait implements list commands.
- Self Type
- ListCommands with NonBlockingConnection
- Alphabetic
- By Inheritance
- ListCommands
- 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(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): 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[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def lIndex[R](key: String, index: Long)(implicit arg0: Reader[R]): Future[Option[R]]
Returns an element from a list by its index.
Returns an element from a list by its index.
- key
list key
- index
zero-based position in the list
- returns
the requested element, or
None
when index is out of range
- Since
1.0.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if key contains a non-list value- Note
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.
- def lInsert[W1, W2](key: String, position: Position, pivot: W1, value: W2)(implicit arg0: Writer[W1], arg1: Writer[W2]): Future[Option[Long]]
Inserts an element before or after another element in a list.
Inserts an element before or after another element in a list.
- key
list key
- position
tell if a new value should be placed after of before pivot
- pivot
value after/before which the element should be inserted
- value
element to be inserted
- returns
the length of the list after the insert operation, or None if the index is out of range
- Since
2.2.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if key contains a non-list value
- def lLen(key: String): Future[Long]
Returns the length of a list.
Returns the length of a list.
- key
list key
- returns
the length of the list at key, or 0 if the key does not exist
- Since
1.0.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if key contains a non-list value
- def lPop[R](key: String)(implicit arg0: Reader[R]): Future[Option[R]]
Removes and returns the first element of a list.
Removes and returns the first element of a list.
- key
list key
- returns
the popped element, or
None
if the key does not exist
- Since
1.0.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if key contains a non-list value
- def lPush[W](key: String, values: W*)(implicit arg0: Writer[W]): Future[Long]
Prepends one or multiple values to a list.
Prepends one or multiple values to a list.
- key
list key
- values
value(s) to prepend
- returns
the length of the list after the push operations
- Since
1.0.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if key contains a non-list value- Note
If key does not exist, it is created as empty list before performing the push operation. Redis versions older than 2.4 can only push one value per call.
- def lPushX[W](key: String, value: W)(implicit arg0: Writer[W]): Future[Long]
Prepends a value to a list, only if the list exists.
Prepends a value to a list, only if the list exists.
- key
list key
- value
value to prepend
- returns
the length of the list after the push operation
- Since
2.2.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if key contains a non-list value
- def lRange[R](key: String, start: Long = 0, stop: Long = -1)(implicit arg0: Reader[R]): Future[List[R]]
Returns a range of elements from a list.
Returns a range of elements from a list.
- key
list key
- start
start offset (inclusive)
- stop
stop offset (inclusive)
- returns
list of elements in the specified range, or the empty list if there are no such elements or the key does not exist
- Since
1.0.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if key contains a non-list value- Note
The offsets start and end 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. These offsets can also be negative numbers indicating offsets starting at the end of the list. For example, -1 is the last element of the list, -2 the penultimate, and so on. Both offsets are inclusive, i.e. LRANGE key 0 10 will return 11 elements (if they exist).
- def lRem[W](key: String, value: W, count: Int = 0)(implicit arg0: Writer[W]): Future[Long]
Removes the first count occurrences of elements equal to value from the list stored at key.
Removes the first count occurrences of elements equal to value from the list stored at key.
- key
list key
- value
value to be removed from the list
- count
indicates the number of found values that should be removed, see above note
- returns
the number of removed elements
- Since
1.0.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if key contains a non-list value- Note
The count argument influences the operation in the following ways:
count > 0: Remove elements equal to value moving from head to tail. count < 0: Remove elements equal to value moving from tail to head. count = 0: Remove all elements equal to value.
- def lSet[W](key: String, index: Long, value: W)(implicit arg0: Writer[W]): Future[Unit]
Sets the value of an element in a list by its index.
Sets the value of an element in a list by its index.
- key
list key
- index
position of the element to set
- value
value to be set at index
- Since
1.0.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if index is out of range or if key contains a non-list value
- def lTrim(key: String, start: Long, stop: Long): Future[Unit]
Trims a list to the specified range.
Trims a list to the specified range.
- key
list key
- start
start offset (inclusive)
- stop
stop offset (inclusive)
- Since
1.0.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if key contains a non-list value- Note
Out of range indexes will not produce an error: if start is larger than the end of the list, or start > end, the result will be an empty list (which causes key to be removed). If end is larger than the end of the list, Redis will treat it like the last element of the list.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def rPop[R](key: String)(implicit arg0: Reader[R]): Future[Option[R]]
Removes and returns the last element of a list.
Removes and returns the last element of a list.
- key
list key
- returns
the popped element, or
None
if the key does not exist
- Since
1.0.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if key contains a non-list value
- def rPopLPush[R](sourceKey: String, destKey: String)(implicit arg0: Reader[R]): Future[Option[R]]
Removes the last element in a list, appends it to another list and returns it.
Removes the last element in a list, appends it to another list and returns it.
- sourceKey
key of list to be pop from
- destKey
key of list to be push to
- returns
the popped element, or
None
if the key does not exist
- Since
1.2.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if key contains a non-list value
- def rPush[W](key: String, values: W*)(implicit arg0: Writer[W]): Future[Long]
Appends one or multiple values to a list.
Appends one or multiple values to a list.
- key
list key
- values
value(s) to prepend
- returns
the length of the list after the push operations
- Since
1.0.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if key contains a non-list value- Note
If key does not exist, it is created as empty list before performing the push operation. Redis versions older than 2.4 can only push one value per call.
- def rPushX[W](key: String, value: W)(implicit arg0: Writer[W]): Future[Long]
Appends a value to a list, only if the list exists.
Appends a value to a list, only if the list exists.
- key
list key
- value
value to prepend
- returns
the length of the list after the push operation
- Since
2.2.0
- Exceptions thrown
[[scredis.exceptions.RedisErrorResponseException]]
if key contains a non-list value
- 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(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()