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

> Reference and syntax for CREATE LOCATION with a MongoDB source.

# CREATE LOCATION (MongoDB)

<Warning>
  **Private Preview Feature**

  This feature is currently in private preview. Contact [support@firebolt.io](mailto:support@firebolt.io) to request early access.
</Warning>

Creates a location object that stores the connection URI and credentials for a MongoDB deployment, for use with [change data capture streams](/guides/change-data-capture/mongodb).

## Syntax

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
CREATE LOCATION [IF NOT EXISTS] <location_name> WITH
    SOURCE = MONGODB
    URI = '<connection_uri>'
    [USER = '<user>']
    [PASSWORD = '<password>']
    [TLS_CA_FILE = '<ca_file>']
    [DESCRIPTION = '<description>'];
```

## Parameters

| Parameter          | Description                                                                                                                                                                 |
| :----------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `<location_name>`  | A unique identifier for the location within your account.                                                                                                                   |
| `SOURCE`           | Must be `MONGODB`.                                                                                                                                                          |
| `URI`              | MongoDB connection string (`mongodb://` or `mongodb+srv://`). Required. The deployment must be a replica set or sharded cluster; standalone servers have no change streams. |
| `USER`, `PASSWORD` | Credentials for the connection. Optional, but must be supplied together. Credentials embedded in the URI work as well.                                                      |
| `TLS_CA_FILE`      | Optional CA certificate for deployments with a private certificate authority.                                                                                               |
| `DESCRIPTION`      | Optional metadata describing the location's purpose.                                                                                                                        |

## TLS

TLS follows the URI: `mongodb+srv://` connections use TLS, and plain `mongodb://` URIs can request it with the `tls=true` URI option.

## Example

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
CREATE LOCATION mongo_prod WITH
    SOURCE = MONGODB
    URI = 'mongodb+srv://cluster0.example.mongodb.net/'
    USER = 'firebolt_cdc'
    PASSWORD = '********'
    DESCRIPTION = 'Production Atlas cluster';
```

## Related

* [MongoDB CDC](/guides/change-data-capture/mongodb): source prerequisites and end-to-end setup.
* [CREATE STREAM](/reference-sql/commands/data-definition/create-stream#mongodb-streams): bind a stream to a collection in this location.
* [CREATE LOCATION](/reference-sql/commands/data-definition/create-location): location objects in general.
* [DROP LOCATION](/reference-sql/commands/data-definition/drop-location)
