콘텐츠로 이동
Docs Try Aspire
Docs Try

Use community extensions for MongoDB hosting

이 콘텐츠는 아직 번역되지 않았습니다.

⭐ Community Toolkit MongoDB logo

The Aspire Community Toolkit MongoDB hosting extensions package provides extra functionality to the Aspire.Hosting.MongoDB hosting package.

This package provides the following features:

To get started with the Aspire Community Toolkit MongoDB hosting extensions, install the CommunityToolkit.Aspire.Hosting.MongoDB.Extensions NuGet package in the AppHost project.

Aspire CLI — CommunityToolkit.Aspire.Hosting.MongoDB.Extensions 패키지 추가
aspire add communitytoolkit-mongodb-extensions

Aspire CLI는 대화형입니다. 프롬프트 시 알맞은 검색 결과 선택:

Aspire CLI — 출력 예시
Select an integration to add:
> communitytoolkit-mongodb-extensions (CommunityToolkit.Aspire.Hosting.MongoDB.Extensions)
> Other results listed as selectable options...

For TypeScript AppHosts, add the Community Toolkit MongoDB extensions package to aspire.config.json:

aspire.config.json
{
"packages": {
"CommunityToolkit.Aspire.Hosting.MongoDB.Extensions": "*"
}
}

To add the DbGate management UI to your MongoDB resource, call the WithDbGate method on the MongoDBResourceBuilder instance:

C# — AppHost.cs
var builder = DistributedApplication.CreateBuilder(args);
var mongodb = builder.AddMongoDB("mongodb")
.WithDbGate();
builder.AddProject<Projects.ExampleProject>("api")
.WithReference(mongodb);
builder.Build().Run();

This adds a new DbGate resource to the AppHost which is available from the Aspire dashboard. DbGate is a comprehensive database management tool that provides a web-based interface for managing your MongoDB databases.