# `Aerospike.Exp.Map`
[🔗](https://github.com/luisgabrielroldan/aerospike_driver/blob/v0.3.1/lib/aerospike/exp/map.ex#L1)

Map CDT expression helpers.

# `opts`

```elixir
@type opts() :: [policy: policy(), return_type: return_type()]
```

Common map expression options.

Supported keys:

* `:policy` - map write policy for put/increment expressions.
* `:return_type` - selector return type from the `return_*` helpers.

# `policy`

```elixir
@type policy() :: Aerospike.Op.Map.policy()
```

Map expression write policy accepted in `opts[:policy]`.

# `return_type`

```elixir
@type return_type() :: Aerospike.Op.Map.return_type()
```

Map selector return type.

# `t`

```elixir
@type t() :: Aerospike.Exp.t()
```

Opaque server-side expression.

# `clear`

```elixir
@spec clear(Aerospike.Exp.t()) :: t()
```

Removes all entries from the map expression.

# `get_by_index`

```elixir
@spec get_by_index(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.exp_type(),
  opts()
) :: t()
```

Returns the entry at `index`, selected by `return_type:`.

# `get_by_index_range`

```elixir
@spec get_by_index_range(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  opts()
) :: t()
```

Returns `count` entries from `index`, selected by `return_type:`.

# `get_by_index_range_from`

```elixir
@spec get_by_index_range_from(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()
```

Returns entries from `index` through the end, selected by `return_type:`.

# `get_by_key`

```elixir
@spec get_by_key(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.exp_type(),
  opts()
) :: t()
```

Returns the entry for `key`, selected by `return_type:`.

# `get_by_key_list`

```elixir
@spec get_by_key_list(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()
```

Returns entries matching any key in `keys`, selected by `return_type:`.

# `get_by_key_range`

```elixir
@spec get_by_key_range(
  Aerospike.Exp.t(),
  Aerospike.Exp.t() | nil,
  Aerospike.Exp.t() | nil,
  opts()
) ::
  t()
```

Returns entries with keys in `[begin_key, end_key)`, selected by `return_type:`.

# `get_by_key_rel_index_range`

```elixir
@spec get_by_key_rel_index_range(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  opts()
) :: t()
```

Returns entries nearest to `key` and greater by relative `index`.

# `get_by_key_rel_index_range_count`

```elixir
@spec get_by_key_rel_index_range_count(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  opts()
) :: t()
```

Returns `count` entries nearest to `key` and greater by relative `index`.

# `get_by_rank`

```elixir
@spec get_by_rank(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.exp_type(),
  opts()
) :: t()
```

Returns the entry at `rank`, selected by `return_type:`.

# `get_by_rank_range`

```elixir
@spec get_by_rank_range(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  opts()
) :: t()
```

Returns `count` entries from `rank`, selected by `return_type:`.

# `get_by_rank_range_from`

```elixir
@spec get_by_rank_range_from(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()
```

Returns entries from `rank` through the highest rank, selected by `return_type:`.

# `get_by_value`

```elixir
@spec get_by_value(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()
```

Returns entries equal to `value`, selected by `return_type:`.

# `get_by_value_list`

```elixir
@spec get_by_value_list(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()
```

Returns entries matching any value in `values`, selected by `return_type:`.

# `get_by_value_range`

```elixir
@spec get_by_value_range(
  Aerospike.Exp.t(),
  Aerospike.Exp.t() | nil,
  Aerospike.Exp.t() | nil,
  opts()
) ::
  t()
```

Returns entries with values in `[begin_value, end_value)`, selected by `return_type:`.

# `get_by_value_rel_rank_range`

```elixir
@spec get_by_value_rel_rank_range(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  opts()
) ::
  t()
```

Returns entries nearest to `value` and greater by relative `rank`.

# `get_by_value_rel_rank_range_count`

```elixir
@spec get_by_value_rel_rank_range_count(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  opts()
) :: t()
```

Returns `count` entries nearest to `value` and greater by relative `rank`.

# `increment`

```elixir
@spec increment(Aerospike.Exp.t(), Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) ::
  t()
```

Increments the numeric value at `key` and returns the final value. Supports `policy:`.

# `put`

```elixir
@spec put(Aerospike.Exp.t(), Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()
```

Writes one key/value pair and returns the map size. Supports `policy:`.

# `put_items`

```elixir
@spec put_items(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()
```

Writes map expression `values` and returns the map size. Supports `policy:`.

# `remove_by_index`

```elixir
@spec remove_by_index(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()
```

Removes the entry at `index`, returning data selected by `return_type:`.

# `remove_by_index_range`

```elixir
@spec remove_by_index_range(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  opts()
) :: t()
```

Removes `count` entries from `index`, returning selected data.

# `remove_by_index_range_from`

```elixir
@spec remove_by_index_range_from(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()
```

Removes entries from `index` through the end, returning selected data.

# `remove_by_key`

```elixir
@spec remove_by_key(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()
```

Removes the entry for `key`, returning data selected by `return_type:`.

# `remove_by_key_list`

```elixir
@spec remove_by_key_list(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()
```

Removes entries matching any key in `keys`, returning selected data.

# `remove_by_key_range`

```elixir
@spec remove_by_key_range(
  Aerospike.Exp.t(),
  Aerospike.Exp.t() | nil,
  Aerospike.Exp.t() | nil,
  opts()
) ::
  t()
```

Removes entries with keys in `[begin_key, end_key)`, returning selected data.

# `remove_by_key_rel_index_range`

```elixir
@spec remove_by_key_rel_index_range(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  opts()
) ::
  t()
```

Removes entries nearest to `key` and greater by relative `index`.

# `remove_by_key_rel_index_range_count`

```elixir
@spec remove_by_key_rel_index_range_count(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  opts()
) :: t()
```

Removes `count` entries nearest to `key` and greater by relative `index`.

# `remove_by_rank`

```elixir
@spec remove_by_rank(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()
```

Removes the entry at `rank`, returning data selected by `return_type:`.

# `remove_by_rank_range`

```elixir
@spec remove_by_rank_range(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  opts()
) :: t()
```

Removes `count` entries from `rank`, returning selected data.

# `remove_by_rank_range_from`

```elixir
@spec remove_by_rank_range_from(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()
```

Removes entries from `rank` through the highest rank, returning selected data.

# `remove_by_value`

```elixir
@spec remove_by_value(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()
```

Removes entries equal to `value`, returning data selected by `return_type:`.

# `remove_by_value_list`

```elixir
@spec remove_by_value_list(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()
```

Removes entries matching any value in `values`, returning selected data.

# `remove_by_value_range`

```elixir
@spec remove_by_value_range(
  Aerospike.Exp.t(),
  Aerospike.Exp.t() | nil,
  Aerospike.Exp.t() | nil,
  opts()
) ::
  t()
```

Removes entries with values in `[begin_value, end_value)`, returning selected data.

# `remove_by_value_rel_rank_range`

```elixir
@spec remove_by_value_rel_rank_range(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  opts()
) ::
  t()
```

Removes entries nearest to `value` and greater by relative `rank`.

# `remove_by_value_rel_rank_range_count`

```elixir
@spec remove_by_value_rel_rank_range_count(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  opts()
) :: t()
```

Removes `count` entries nearest to `value` and greater by relative `rank`.

# `return_count`

```elixir
@spec return_count() :: 5
```

Return the selected item count.

# `return_exists`

```elixir
@spec return_exists() :: 13
```

Return whether matching entries exist.

# `return_index`

```elixir
@spec return_index() :: 1
```

Return selected item indexes.

# `return_inverted`

```elixir
@spec return_inverted() :: 65536
```

Invert the selector so it applies outside the matched range.

# `return_key`

```elixir
@spec return_key() :: 6
```

Return selected keys.

# `return_key_value`

```elixir
@spec return_key_value() :: 8
```

Return selected key/value pairs.

# `return_none`

```elixir
@spec return_none() :: 0
```

Return no result for a selector expression.

# `return_ordered_map`

```elixir
@spec return_ordered_map() :: 17
```

Return selected entries as an ordered map.

# `return_rank`

```elixir
@spec return_rank() :: 3
```

Return selected value ranks.

# `return_reverse_index`

```elixir
@spec return_reverse_index() :: 2
```

Return selected reverse indexes, counted from the map end.

# `return_reverse_rank`

```elixir
@spec return_reverse_rank() :: 4
```

Return selected reverse ranks, counted from the highest value.

# `return_unordered_map`

```elixir
@spec return_unordered_map() :: 16
```

Return selected entries as an unordered map.

# `return_value`

```elixir
@spec return_value() :: 7
```

Return selected values.

# `size`

```elixir
@spec size(Aerospike.Exp.t()) :: t()
```

Returns the number of entries in the map expression.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
