NebulexRedisAdapter v1.1.0 NebulexRedisAdapter.DataType.List behaviour View Source
Lists API.
This API is based on Redis Lists API.
Link to this section Summary
Callbacks
Removes and returns the first element of the list stored at key
, or nil
when key does not exist.
Insert all the specified values at the head of the list stored at key
.
If key
does not exist, it is created as empty list before performing
the push operations. When key holds a value that is not a list, an error
is raised.
Returns the specified elements of the list stored at key
. The offset
is an integer >= 1 and the limit
an integer >= 0.
Removes and returns the last element of the list stored at key
, or nil
when key does not exist.
Insert all the specified values at the tail of the list stored at key
.
If key does not exist, it is created as empty list before performing
the push operation. When key holds a value that is not a list, an error
is raised.
Link to this section Types
cache()
View Source
cache() :: Nebulex.Cache.t()
cache() :: Nebulex.Cache.t()
key()
View Source
key() :: Nebulex.Cache.key()
key() :: Nebulex.Cache.key()
opts()
View Source
opts() :: Nebulex.Cache.opts()
opts() :: Nebulex.Cache.opts()
value()
View Source
value() :: Nebulex.Cache.value()
value() :: Nebulex.Cache.value()
Link to this section Callbacks
lpop(cache, key, opts) View Source
Removes and returns the first element of the list stored at key
, or nil
when key does not exist.
See Nebulex.Cache.lpop/2
.
lpush(cache, key, elements, opts) View Source
Insert all the specified values at the head of the list stored at key
.
If key
does not exist, it is created as empty list before performing
the push operations. When key holds a value that is not a list, an error
is raised.
Returns the length of the list after the push operations.
lrange(cache, key, offset, limit, opts)
View Source
lrange(
cache(),
key(),
offset :: pos_integer(),
limit :: non_neg_integer(),
opts()
) :: [value()] | no_return()
lrange( cache(), key(), offset :: pos_integer(), limit :: non_neg_integer(), opts() ) :: [value()] | no_return()
Returns the specified elements of the list stored at key
. The offset
is an integer >= 1 and the limit
an integer >= 0.
rpop(cache, key, opts) View Source
Removes and returns the last element of the list stored at key
, or nil
when key does not exist.
See Nebulex.Cache.rpop/2
.
rpush(cache, key, elements, opts) View Source
Insert all the specified values at the tail of the list stored at key
.
If key does not exist, it is created as empty list before performing
the push operation. When key holds a value that is not a list, an error
is raised.
Returns the length of the list after the push operations.