🔌Setting up a MongoDB connector

This connector is used to retrieve data from a MongoDB database, which is also a NoSQL database. This is a clear example that shows Toucan’s vast spectrum of connectivity, allowing our users to connect to RDBMS’s as well as NoSQL DB’s like MongoDB with ease!

Configuring the MongoDB connector in Toucan

Fill in the connection information:

  • host: The domain name or IP address of your database server, for mongodb atlas you will use the full connection string for example mongodb+srv://:@.mongodb.net/?retryWrites=true&w=majority

  • port: (Optional) The listening port of your database server

  • username: (Optional) Your login username

  • password: (Optional) Your login password

  • ssl: (Optional) Boolean flag to create the connection using SSL

  • max_pool_size: Maximum number of connections in the connection pool (default: 1)

MongoDB connection form

Then click TEST CONNECTION

MongoDB Test connection

and finally SAVE it.

Selecting data from MongoDB

To create a dataset from MongoDB, click on the "create from icon", you will then be able to:

  • database: The name of the database you want to query

  • collection: The name of the collection you want to query

  • Add a Query (optional): Use MongoDB aggregation pipeline to queries your collections , and return only the relevant results. After inputting your query, select "Preview" to review the results, and then click "Save" to create a dataset based on your chosen selection.

Query a datasource MongoDB

Error Handling

The connector handles various error scenarios, including:

  • Unknown database (UnkwownMongoDatabase)

  • Unknown collection (UnkwownMongoCollection)

  • Connection errors

  • Authentication failures

For more info, see the dedicated section Creating datasets

Last updated

Was this helpful?