MongoDB Atlas
MongoDB Atlas is a fully-managed cloud database service built on MongoDB. It provides automated backups, monitoring, and scaling capabilities across major cloud providers.
Bruin supports MongoDB Atlas as a data platform for both ingestion sources and destinations.
NOTE
MongoDB Atlas is supported as both a source and destination for ingestion using Ingestr Assets. It cannot be used for SQL-based transformations or other asset types.
Connection
To set up a MongoDB Atlas connection, you need to add a configuration item to connections in the .bruin.yml file complying with the following schema.
connections:
mongo_atlas:
- name: "connection_name"
username: "your-username"
password: "your-password"
host: "cluster0.example.mongodb.net"
database: "your-database"Parameters:
username: MongoDB Atlas database usernamepassword: MongoDB Atlas database passwordhost: MongoDB Atlas cluster hostname (e.g.,cluster0.example.mongodb.net)database: The database name to connect to
NOTE
The connection uses the mongodb+srv:// protocol which is the standard for MongoDB Atlas connections. You don't need to specify the protocol in the configuration.
Using MongoDB Atlas as a Destination
MongoDB Atlas can be used as a destination for Ingestr Assets. This allows you to load data from various sources into your MongoDB Atlas cluster.
Example: Load data from PostgreSQL to MongoDB Atlas
name: ingest.users
type: ingestr
connection: postgres
parameters:
source_connection: postgres
source_table: 'public.users'
destination: mongo_atlas
destination_connection: mongo_atlas
destination_table: 'users'This configuration will:
- Extract data from the
public.userstable in PostgreSQL - Load the data into the
userscollection in your MongoDB Atlas database
Using MongoDB Atlas as a Source
MongoDB Atlas can also be used as a source for Ingestr Assets. This allows you to ingest data from your MongoDB Atlas cluster into various destinations such as data warehouses.
Example: Load data from MongoDB Atlas to PostgreSQL
name: public.atlas_users
type: ingestr
connection: postgres
parameters:
source_connection: mongo_atlas
source_table: 'users.details'
destination: postgresThis configuration will:
- Extract data from the
users.detailscollection in your MongoDB Atlas database - Load the data into the
public.atlas_userstable in PostgreSQL