MongoDB Connection¶
The MongoDB connection type enables the MongoDB Integrations.
Authenticating to MongoDB¶
Authenticate to mongo using a mongo connection string.
Default Connection IDs¶
Some hooks and sensors related to Mongo use mongo_default
by default.
Configuring the Connection¶
- Login (optional)
MongoDB username that used in the connection string for the database you wish to connect too.
- Password (optional)
MongoDB password that used in the connection string for the database you wish to connect too.
- Port (optional)
MongoDB database port number used with in the connection string.
- Host (optional)
The hostname for the standalone mongodb instance used in the connection string.
- Schema (optional)
Any information that you would like to specify after the port number in the connections string. Such as the authentication database.
- Extra (optional)
Specify the extra parameters (as json dictionary) that can be used in Azure connection. The following parameters are all optional:
srv
: (bool) Specify if to use srv to indicate that the hostname corresponds to DNS SRV record. False by default.ssl
: (bool) Specify to use SSL to connect instead of certs.**options
: The rest of the json object can be used to specify options sent to the mongo client.
When specifying the connection in environment variable you should specify it using URI syntax.
Note that all components of the URI should be URL-encoded. The URI and the mongo connection string are not the same.
For example:
export AIRFLOW_CONN_MONGO_DEFAULT='mongo://username:password@mongodb.example.com:27317/%3FauthSource%3Dadmin'