# `Xitdb.Collection`
[🔗](https://github.com/boxxxie/xitdb-elixir/blob/v1.0.1/lib/xitdb/collection.ex#L1)

Explicit wrapper struct for selecting a specific `xitdb` persistent collection
backing structure when writing nested data in `Xitdb.transact/3`.

Supported `:kind` values:
- `:hash_map` — 16-way HAMT (`Tag.Hash_Map`, `.key`)
- `:counted_hash_map` — 16-way HAMT with $O(1)$ count header (`Tag.Counted_Hash_Map`, `#key`)
- `:sorted_map` — Count-augmented B+Tree ordered lexicographically (`Tag.Sorted_Map`, `$key`)
- `:array_list` — 16-way Radix Trie (`Tag.Array_List`, `[i]`)
- `:linked_array_list` — Count-augmented B-Tree with $O(\log N)$ insert/remove/slice (`Tag.Linked_Array_List`, `[[i]]`)
- `:hash_set` — 16-way HAMT set (`Tag.Hash_Set`, `%member`)
- `:counted_hash_set` — 16-way HAMT set with $O(1)$ count header (`Tag.Counted_Hash_Set`, `#%member`)
- `:sorted_set` — Count-augmented B+Tree set (`Tag.Sorted_Set`, `^member`)

# `kind`

```elixir
@type kind() ::
  :hash_map
  | :counted_hash_map
  | :sorted_map
  | :array_list
  | :linked_array_list
  | :hash_set
  | :counted_hash_set
  | :sorted_set
```

# `t`

```elixir
@type t() :: %Xitdb.Collection{data: term(), kind: kind()}
```

---

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