> 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/set-default.md).

# Set as default

Make a database integration the default of its environment.

**Where:** Database → Integrations → *integration* → **Actions** → **Set as default** · `/projects/<project>/db/integrations/<integrationId>/edit`

The **default** integration is the database every record call uses when it names no `databaseIntegrationId`. There is one default per environment.

## Before you start

* The integration is saved and **enabled**. **Set as default** is off for a disabled integration and for the one that already is the default.
* Moving the default moves where new records go: collections in the old default are not copied over.
* You need `database:update` on the integration.

## Steps

1. Open **Database → Integrations** and click the integration.
2. Open **Actions** (top right) and choose **Set as default**.

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-13fb0b6d9e625dc81a2403c9376d8128caaa0c3e%2Fset-default-1.png?alt=media" alt="Editing MongoDB integration Reporting replica, badges ENABLED and TESTED, with the Actions menu open: Set as default, Disable, See MongoDB documentation, See SDK documentation, See API documentation, Delete"><figcaption><p>Actions → Set as default.</p></figcaption></figure>

## Result

The integration gets the **DEFAULT** badge in the list, and the earlier default loses it. Record calls without `databaseIntegrationId` now use this database.

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-238781a3ee8834773c86dfdb815a42c0e09f439f%2Fset-default-2.png?alt=media" alt="Database Integrations list: Reporting replica with the DEFAULT badge, Primary Database without it"><figcaption><p>Reporting replica is now the default.</p></figcaption></figure>

## Change or remove it later

* Set another integration as default the same way.
* A default integration can be disabled or deleted — see [Disable or delete an integration](/codemash/cloud/integrations/disable.md); deleting it asks you to paste its id.

## Do it from code

```ts
await norbix.hub.database.setDatabaseIntegrationAsDefault({ id });
```

```sh
norbix hub database integration as default set --id int_16tRKvLqwNnK1sPWkSkNUV
```

The client setup is on the [Database page](/codemash/cloud/database.md#use-it-from-code). API: [Set Database Integration As Default](/codemash/api-reference/database/integrations/set-database-integration-as-default.md)
