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

Link to this section Callbacks

Link to this callback

lpop(cache, key, opts) View Source
lpop(cache(), key(), opts()) :: nil | value() | no_return()

Removes and returns the first element of the list stored at key, or nil when key does not exist.

See Nebulex.Cache.lpop/2.

Link to this callback

lpush(cache, key, elements, opts) View Source
lpush(cache(), key(), elements :: [value()], opts()) :: integer() | no_return()

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.

See Nebulex.Cache.lpush/3.

Link to this callback

lrange(cache, key, offset, limit, opts) View Source
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.

See Nebulex.Cache.lrange/4.

Link to this callback

rpop(cache, key, opts) View Source
rpop(cache(), key(), opts()) :: nil | value() | no_return()

Removes and returns the last element of the list stored at key, or nil when key does not exist.

See Nebulex.Cache.rpop/2.

Link to this callback

rpush(cache, key, elements, opts) View Source
rpush(cache(), key(), elements :: [value()], opts()) :: integer() | no_return()

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.

See Nebulex.Cache.rpush/3.