इसे छोड़कर कंटेंट पर जाएं
DocsTry Aspire
DocsTry

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:

  • DbGate management UI
  • dbx management UI

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, decorate the official MongoDBServerResource builder with WithDbGate / withDbGate:

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.

dbx is a lightweight, web-based database client and an alternative management UI to DbGate and Adminer. Use WithDbx / withDbx to add a dbx child resource configured for the MongoDB server:

AppHost.cs
var builder = DistributedApplication.CreateBuilder(args);
var mongodb = builder.AddMongoDB("mongodb")
.WithDbx();
builder.Build().Run();

The C# overload accepts an optional container configuration callback and containerName. The TypeScript binding accepts optional containerName and imageTag values.