Category / Section
How to Connect to MongoDB Atlas via REST API?
Published:
Connecting MongoDB Atlas as a live data source using Bold BI’s generic Web API connector is a simple process. Follow the steps below to connect MongoDB Atlas using the Generic web API connector.
Prerequisites
- MongoDB Atlas account
- Bold BI account
Steps to Connect MongoDB Atlas
-
Log in to your MongoDB Atlas account and copy the endpoint URL in the Data API section.
-
Obtain your API key in the API keys section.
-
In Bold BI, choose Generic Web Connector and make a POST API request with the following details:
- URL:
https://<<:Yourdomain>>/app/data-mawaw/endpoint/data/v1/action/find
- Method: POST
- Request Body: Raw
- Raw body:
- Mode: Live (for live connection)
- URL:
{
"dataSource": "<your data source>",
"database": "<your database>",
"collection": "<your collection>"
}
Limitations
There are a few limitations when using the REST API over the client library connection:
- The REST API option is only available for MongoDB Atlas servers and not for MongoDB hosted in local or any other servers. Refer here
- The Data API limits request traffic to 10,000 concurrent requests. Refer here
- Multiple collections (tables) cannot be connected at once and will need to be created as separate data sources.
- Operations called through a Data API endpoint take longer to complete than the corresponding MongoDB operations called through a driver, i.e., the MongoDB connector in Bold BI. Refer here
Alternative Options
You can also connect MongoDB as a live connection via ODBC and CData connectors. Refer here