> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/cloud/integrations.md).

# Integrations

Database integrations — the MongoDB databases your project stores its collections in.

**Where:** Database → Integrations · `/projects/<project>/db/integrations`

A database **integration** is a MongoDB connection that your project stores its collections in: your own cluster through a connection string, or a managed Atlas Flex cluster that Norbix runs. A project can have several; one is the **default** of each environment, and every record call can name another one. The rules that are the same in every module are on the [Integrations](/codemash/cloud/concepts/integrations.md) concept page.

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-9ae038ca19f4a695a0dee371c891c3725c7fea57%2Fintegrations-list-1.png?alt=media" alt="Database Integrations list with the columns Integration Name, Provider, Env, Last Test Succeeded, Enabled and Default: Primary Database (MongoDB Connection String, PROD, Enabled True, DEFAULT badge) and Reporting replica (MongoDB Connection String, PROD, Last Test Succeeded True, Enabled True); Add New Integration at the top right"><figcaption><p>Database → Integrations.</p></figcaption></figure>

## Columns, search and filters

| Column              | What it shows                                                                    |
| ------------------- | -------------------------------------------------------------------------------- |
| Integration Name    | The name. Click it to open the integration.                                      |
| Provider            | *MongoDB Connection String* or *Norbix MongoDB Atlas (Flex Managed)*.            |
| Env                 | The environment of this copy (PROD, TEST, …).                                    |
| Last Test Succeeded | `True` after a passed test, `False` after a failed one, empty when never tested. |
| Enabled             | `True` or `False`.                                                               |
| Default             | A **DEFAULT** badge on the default integration of the environment.               |

The list shows the integrations of the environment you are working in. With several enabled integrations and no default, the page warns **No Default Set For Active Integrations**. Reading needs `database:read` on the integrations; adding needs `database:create` on `database:integration:all`.

## What you can do here

* [Connect a provider](/codemash/cloud/integrations/providers.md) — **Add New Integration** → [MongoDB](/codemash/cloud/integrations/providers/mongodb.md) (connection string or Atlas Flex).
* [Test an integration](/codemash/cloud/integrations/test.md) — **Test integration** on its page.
* [Set as default](/codemash/cloud/integrations/set-default.md) — **Actions** → **Set as default**.
* [Disable or delete an integration](/codemash/cloud/integrations/disable.md) — **Actions** → **Disable** / **Delete**.
* **Every environment has its own copy.** One integration id can live in PROD and TEST (after a [promotion](/codemash/cloud/project/settings/environments.md#promote-content-up-the-ladder)); each copy has its own connection string, and Save, Delete, Enable, Disable, Set as default and Test act on the copy of the environment you are working in only.
* Records, terms and scheduled tasks use the integration copy of their own environment.

## Do it from code

```ts
const { list, defaultIntegrationId } = await norbix.hub.database.getDatabaseIntegrations();
console.log(defaultIntegrationId, list.items.map((i) => `${i.integrationName} ${i.provider} ${i.env}`));
// int_16tRKvLqwNnK1sPWkSkNUV [ 'Primary Database MongoDbConnectionString PROD' ]
```

```sh
norbix hub database integrations get
```

API: [Get Database Integrations](/codemash/api-reference/database/integrations/get-database-integrations.md) · [Database → Integrations](/codemash/api-reference/database/integrations.md)
