Skip to content
DocsTry Aspire
DocsTry

MongoDBServerResource Properties

ClassProperties9 members
A resource that represents a MongoDB container.
ConnectionStringExpressionSection titled ConnectionStringExpressionReferenceExpression
Gets the connection string for the MongoDB server.
public ReferenceExpression ConnectionStringExpression { get; }
DatabasesSection titled DatabasesIReadOnlyDictionary<string, string>
A dictionary where the key is the resource name and the value is the database name.
public IReadOnlyDictionary<string, string> Databases { get; }
HostSection titled HostEndpointReferenceExpression
Gets the host endpoint reference for this resource.
public EndpointReferenceExpression Host { get; }
PasswordParameterSection titled PasswordParameternullableParameterResource?
Gets the parameter that contains the MongoDb server password.
public ParameterResource? PasswordParameter { get; }
PortSection titled PortEndpointReferenceExpression
Gets the port endpoint reference for this resource.
public EndpointReferenceExpression Port { get; }
PrimaryEndpointSection titled PrimaryEndpointEndpointReference
Gets the primary endpoint for the MongoDB server.
public EndpointReference PrimaryEndpoint { get; }
UriExpressionSection titled UriExpressionReferenceExpression
Gets the connection URI expression for the MongoDB server.
public ReferenceExpression UriExpression { get; }
Format: mongodb://[user:password@]{host}:{port}[?authSource=admin&authMechanism=SCRAM-SHA-256]. The credential and query segments are included only when a password is configured.
UserNameParameterSection titled UserNameParameternullableParameterResource?
Gets the parameter that contains the MongoDb server username.
public ParameterResource? UserNameParameter { get; }
UserNameReferenceSection titled UserNameReferenceReferenceExpression
Gets a reference to the user name for the MongoDB server.
public ReferenceExpression UserNameReference { get; }
Returns the user name parameter if specified, otherwise returns the default user name "admin".