Testcontainers-java: Add Support For MongoDB

Created on 28 Jun 2019  路  5Comments  路  Source: testcontainers/testcontainers-java

On going through documentation I can't find support fr MongoDB.
https://www.testcontainers.org
Kindly add support for MongoDB as well.

resolutioanswered typnew module

Most helpful comment

@ankurpathak
every new module adds an overhead to our CI, maintainability and release process.

We are supporting many databases and we must add support for MongoDB as well.

Testcontainers project provides support for many databases that are not trivial to use with GenericContainer only.

In case of MongoDB, we're talking about the following lines:

new GenericContainer("mongo:4.0").withExposedPort(27017);

Why would you need a dedicated module for that? Isn't it leftpad-ish?

All 5 comments

MongoDB was added as an example in #1288 instead of a module because it is too simple:
https://github.com/testcontainers/testcontainers-java/tree/master/examples/mongodb-container

What is the issue in adding the new module for MondoDB? Its might be simple but inbuild support for it help community a lot as MongoDB is very widely used Document Store. If current contributors have less time to work they can invite community to join and work on it as a PR. We are supporting many databases and we must add support for MongoDB as well.

@ankurpathak
every new module adds an overhead to our CI, maintainability and release process.

We are supporting many databases and we must add support for MongoDB as well.

Testcontainers project provides support for many databases that are not trivial to use with GenericContainer only.

In case of MongoDB, we're talking about the following lines:

new GenericContainer("mongo:4.0").withExposedPort(27017);

Why would you need a dedicated module for that? Isn't it leftpad-ish?

This example work like a champ. @bsideup I agree with u.

@bsideup MongoDB 4 support Transactions. But to test those transactions we need run MongoDb in
Replica Set mode,and its a pain. Can we add a new module for MongoDb to support replica set mode
or give an example for same. So we can test MongoDb Transactions.
Here is a reference url for same:
https://www.baeldung.com/spring-data-mongodb-transactions

Was this page helpful?
0 / 5 - 0 ratings