Skip to content
Docs Try Aspire
Docs Try

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

property connectionStringExpression ReferenceExpression get
Gets the connection string for the MongoDB server.
property databases Dict<string,string> get
A dictionary where the key is the resource name and the value is the database name.
property host EndpointReferenceExpression get
Gets the host endpoint reference for this resource.
property passwordParameter ParameterResource get
Gets the parameter that contains the MongoDb server password.
property port EndpointReferenceExpression get
Gets the port endpoint reference for this resource.
property primaryEndpoint EndpointReference get
Gets the primary endpoint for the MongoDB server.
property uriExpression ReferenceExpression get
Gets the connection URI expression for the MongoDB server.
property userNameParameter ParameterResource get
Gets the parameter that contains the MongoDb server username.
property userNameReference ReferenceExpression get
Gets a reference to the user name for the MongoDB server.

Methods

method addDatabase builder
Adds a MongoDB database to the application model.
addDatabase(
name: string,
databaseName?: string): MongoDBDatabaseResource
name string
databaseName string optional
MongoDBDatabaseResource
method withDataBindMount builder
Adds a bind mount for the data folder to a MongoDB container resource.
withDataBindMount(
source: string,
isReadOnly?: boolean): MongoDBServerResource
source string
isReadOnly boolean optional = False
MongoDBServerResource
method withDataVolume builder
Adds a named volume for the data folder to a MongoDB container resource.
withDataVolume(
name?: string,
isReadOnly?: boolean): MongoDBServerResource
name string optional
isReadOnly boolean optional = False
MongoDBServerResource
method withInitFiles builder
Copies init files into a MongoDB container resource.
withInitFiles(source: string): MongoDBServerResource
source string
MongoDBServerResource
method withMongoExpress builder
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
containerName string optional
MongoDBServerResource