MongoDbContainer Class
A temporary MongoDB container. Obtain one from MongoDbContainerDefinition.CreateContainer.
public sealed class MongoDbContainer : TemporaryContainer- Inheritance
TemporaryContainerMongoDbContainer
Methods
| Name | Description |
|---|---|
| GetConnectionString(bool) | Gets a MongoDB connection string for the running container (on TemporaryContainer.GetHostAddress), using root credentials configured on the definition. |
GetConnectionString(bool)
MongoDbContainer.csGets a MongoDB connection string for the running container (on TemporaryContainer.GetHostAddress), using root credentials configured on the definition.
Parameters
enableJournalingbool- A value indicating whether to enable journaling (
j=true) in the connection string.
Returns
string The connection string.
Exceptions
InvalidOperationException- The container has not been started.