addMongoDB

Method
📦 Aspire.Hosting.MongoDB v17.0.0
interface IDistributedApplicationBuilder {
// ... omitted for brevity
addMongoDB(
name: string,
port?: number,
userName?: ParameterResource,
password?: ParameterResource): MongoDBServerResource;
}

Signature

methodaddMongoDBbuilder
Adds a MongoDB container resource
addMongoDB(
name: string,
port?: number,
userName?: ParameterResource,
password?: ParameterResource): MongoDBServerResource
namestringThe name of the resource. This name will be used as the connection string name when referenced in a dependency.
portnumberoptionalThe host port for MongoDB.
userNameParameterResourceoptionalA parameter that contains the MongoDb server user name, or `null` to use a default value.
passwordParameterResourceoptionalA parameter that contains the MongoDb server password, or `null` to use a generated password.
MongoDBServerResource

Applies to

This method applies to the following types: