MongoDBServerResource.addDatabase

Method
📦 Aspire.Hosting.MongoDB v17.0.0
interface MongoDBServerResource {
// ... omitted for brevity
addDatabase(
name: string,
databaseName?: string): MongoDBDatabaseResource;
}

Signature

methodaddDatabasebuilder
Adds a MongoDB database to the application model.
addDatabase(
name: string,
databaseName?: string): MongoDBDatabaseResource
namestringThe name of the resource. This name will be used as the connection string name when referenced in a dependency.
databaseNamestringoptionalThe name of the database. If not provided, this defaults to the same value as `name`.
MongoDBDatabaseResource

Defined on

This method is defined on the following type: