Connecting Databases in Mongo
Integrations, or external databases, provide data to be used for making forecasts. Here, we use the databases.insertOne() method to connect the integrations to Mongo.
The db.databases.insertOne()
Method
Description
MindsDB enables adding databases to your Mongo instance using the
db.databases.insertOne()
method.
Our MindsDB Mongo API supports creating a connection by passing the database credentials.
Syntax
Here is the syntax:
On execution, we get:
Where:
Name | Description |
---|---|
name | Identifier for the data source to be created. |
engine | Database engine to be selected. |
connection_args | {"key":"value"} object storing the connection parameters such as port, host, database. |
Example
Creating a New Connection
Here is an example of how to connect to the local MongoDB.
On execution, we get:
Listing Linked Databases
You can list all the linked databases using the following command:
On execution, we get: