Skip to content
DocsTry Aspire
DocsTry

MongoDBServerResource

Handle
📦 Aspire.Hosting.MongoDB v13.4.0
interface MongoDBServerResource
extends IComputeResource,
IExpressionValue,
IManifestExpressionProvider,
IResource,
IResourceWithArgs,
IResourceWithConnectionString,
IResourceWithEndpoints,
IResourceWithEnvironment,
IResourceWithProbes,
IResourceWithWaitSupport,
IValueProvider,
IValueWithReferences {
readonly connectionStringExpression: ReferenceExpression;
readonly databases: Dict<string,string>;
readonly host: EndpointReferenceExpression;
readonly passwordParameter: ParameterResource;
readonly port: EndpointReferenceExpression;
readonly primaryEndpoint: EndpointReference;
readonly uriExpression: ReferenceExpression;
readonly userNameParameter: ParameterResource;
readonly userNameReference: ReferenceExpression;
addDatabase(
name: string,
databaseName?: string): MongoDBDatabaseResource;
withDataBindMount(
source: string,
isReadOnly?: boolean): MongoDBServerResource;
withDataVolume(
name?: string,
isReadOnly?: boolean): MongoDBServerResource;
withInitFiles(source: string): MongoDBServerResource;
withMongoExpress(configureContainer?: (obj: MongoExpressContainerResource) => Promise<void>, containerName?: string): MongoDBServerResource;
}

Properties

propertyconnectionStringExpressionReferenceExpressionget
Gets the connection string for the MongoDB server.
propertydatabasesDict<string,string>get
A dictionary where the key is the resource name and the value is the database name.
propertyhostEndpointReferenceExpressionget
Gets the host endpoint reference for this resource.
propertypasswordParameterParameterResourceget
Gets the parameter that contains the MongoDb server password.
propertyportEndpointReferenceExpressionget
Gets the port endpoint reference for this resource.
propertyprimaryEndpointEndpointReferenceget
Gets the primary endpoint for the MongoDB server.
propertyuriExpressionReferenceExpressionget
Gets the connection URI expression for the MongoDB server.
propertyuserNameParameterParameterResourceget
Gets the parameter that contains the MongoDb server username.
propertyuserNameReferenceReferenceExpressionget
Gets a reference to the user name for the MongoDB server.

Methods

methodaddDatabasebuilder
Adds a MongoDB database to the application model.
addDatabase(
name: string,
databaseName?: string): MongoDBDatabaseResource
namestring
databaseNamestringoptional
MongoDBDatabaseResource
methodwithDataBindMountbuilder
Adds a bind mount for the data folder to a MongoDB container resource.
withDataBindMount(
source: string,
isReadOnly?: boolean): MongoDBServerResource
sourcestring
isReadOnlybooleanoptional= False
MongoDBServerResource
methodwithDataVolumebuilder
Adds a named volume for the data folder to a MongoDB container resource.
withDataVolume(
name?: string,
isReadOnly?: boolean): MongoDBServerResource
namestringoptional
isReadOnlybooleanoptional= False
MongoDBServerResource
methodwithInitFilesbuilder
Copies init files into a MongoDB container resource.
withInitFiles(source: string): MongoDBServerResource
sourcestring
MongoDBServerResource
methodwithMongoExpressbuilder
Adds a MongoExpress administration and development platform for MongoDB to the application model.
withMongoExpress(configureContainer?: (obj: MongoExpressContainerResource) => Promise<void>, containerName?: string): MongoDBServerResource
configureContainer(obj: MongoExpressContainerResource) => Promise<void>optional
containerNamestringoptional
MongoDBServerResource