> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bludia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Collections

> A collection is a table-like container for one type of record. Each collection has a slug used in API URLs, a set of fields, and settings such as filters and totals.

A **collection** defines one type of data in your project, such as `customers`, `orders`, or `tasks`. It's the equivalent of a database table.

## Anatomy of a collection

| Property | Description | Example |
| :- | :- | :- |
| **Name** | Human-readable name shown in the dashboard | `Customers` |
| **Slug** | Unique identifier inside the project, used in API URLs | `customers` |
| **Fields** | The typed attributes each record has | `name`, `email`, `company` |
| **Settings** | Display and query options, such as default filters and column totals | Sum of `amount` |

The slug is what your code uses:

```text theme={null}
GET  /ext/api/v1/collections/customers/records
POST /ext/api/v1/collections/customers
```

> [!WARNING]
>
> Renaming a collection's slug changes its API URLs. Update your apps when you change it.

## Create a collection

**1. Open Collections**

In your project, go to **Collections** → **Create Collection**.

**2. Name it**

Enter a name. Use lowercase, plural slugs such as `customers` or `order_items`.

**3. Add fields**

Add the [fields](https://docs.bludia.com/database/fields.md) each record needs and mark required or unique ones.

**4. Connect it**

Add [relations](https://docs.bludia.com/database/relations.md) to other collections if needed.

## Organize collections

In the sidebar you can group collections into folders (for example **Sales** and **Operations**) and drag them to reorder. Grouping is visual only and doesn't change the API.

## Collection settings

* **Filters:** choose which fields appear as filters in the records view, and the default match mode for text filters (such as `contains` or `exact`).
* **Totals:** show sums or other totals for numeric columns. Totals are also returned by the API in the `totals` key of list responses.

## Design tips

> [accordion] One collection per real-world thing
>
> `customers`, `orders`, and `products` are separate collections connected with relations. Avoid putting unrelated data in one collection.

> [accordion] Use relations instead of duplicating data
>
> Store the customer once and link orders to it. Don't copy the customer's name into every order.

> [accordion] Your users collection is a normal collection
>
> For login, create a collection like `users` with an `email` field, then attach an [authentication guard](https://docs.bludia.com/authentication/guards.md). Add any profile fields you need.

> [accordion] Pick slugs you won't need to change
>
> Slugs appear in URLs, permissions, and hook code (`ctx.Collection("orders")`).

## Project map

**Project map** in the project sidebar draws every collection as a card with its fields and their properties: type, required, unique rules, auto numbers, defaults, validation rules, and computed formulas such as `sum(Payments.amount)`. Lines show relations (solid, with the field name and cardinality such as `N:1`) and the collections a computed field reads from (dashed).

Drag cards to arrange them. Your layout is remembered in this browser, and **Re-arrange** starts over. Click a card to highlight what it connects to, or search for a collection or field.

**Export** downloads the map as:

| Format | Use for |
| :- | :- |
| PNG | Slides, chats, printing |
| SVG | Sharp printing at any size, editing in a vector tool |
| Markdown | A data dictionary: every field with its type and properties |
| Mermaid (`.mmd`) | ER diagrams in docs and wikis that render Mermaid |
| JSON | Your own tools |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.