Skip to content

Document MongoDB single-node replica set mode in hosting integration guide - #1159

Closed
David Pine (IEvangelist) with Copilot wants to merge 1 commit into
mainfrom
copilot/update-documentation-mongodb-replica-set
Closed

David Pine (IEvangelist) with Copilot wants to merge 1 commit into
mainfrom
copilot/update-documentation-mongodb-replica-set

Conversation

Copilot AI commented Jun 2, 2026 •

Copy link
Copy Markdown
Contributor

The MongoDB hosting docs did not cover the new single-node replica set support added in Aspire, leaving gaps for users who need transactions or change streams. This updates the MongoDB hosting integration page to explain when to enable replica set mode and what behavior changes to expect.

  • Replica set guidance and discoverability

    • Added an intro-level pointer to a new Enable replica set mode section.
    • Added clear guidance on when to use replica sets (transactions/change streams) vs. when to keep standalone mode (routine CRUD).
  • API usage examples (copy/paste)

    • Added AppHost examples for both C# and TypeScript showing replica set enablement.
    var mongo = builder.AddMongoDB("mongo")
        .WithReplicaSet();
    const mongo = await builder.addMongoDB("mongo");
    await mongo.withReplicaSet();
  • Connection and runtime behavior notes

    • Documented that WithReplicaSet() defaults to rs0 and accepts an optional string name override.
    • Added a connection string example showing directConnection=true when replica set mode is enabled.
    • Added a note clarifying that Aspire starts the local MongoDB container as a one-node replica set and initializes it at startup.

Copilot AI linked an issue Jun 2, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Update documentation for MongoDB replica set support Document MongoDB single-node replica set mode in hosting integration guide Jun 2, 2026
@IEvangelist
David Pine (IEvangelist) marked this pull request as ready for review June 30, 2026 08:38
Copilot AI review requested due to automatic review settings June 30, 2026 08:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the MongoDB hosting integration guide to document Aspire’s single-node replica set support, clarifying when and how to enable replica set mode and what connection/runtime behavior to expect.

Changes:

  • Adds an “Enable replica set mode” section with guidance for transactions/change streams vs. standalone CRUD use.
  • Adds C# and TypeScript AppHost examples showing how to enable replica set mode.
  • Documents default replica set naming and provides a connection string example for replica set mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

</TabItem>
</Tabs>

`WithReplicaSet()` uses `rs0` as the default replica set name. In both C# and TypeScript, the optional replica set name argument is a string. Pass a name to override it, for example `WithReplicaSet("myset")`.
When replica set mode is enabled, the connection string your consuming app receives includes `directConnection=true`:

```text title="Connection string example"
mongodb://admin:{mongo-password}@{mongo-host}:{mongo-port}/mongodb?authSource=admin&authMechanism=SCRAM-SHA-256&directConnection=true
David Pine (IEvangelist) added a commit that referenced this pull request Aug 7, 2026
Remove the premature MongoDB replica set guidance because the hosting API has not merged or shipped.

Co-authored-by: Copilot App <[email protected]>
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Frontend HTML artifact ready

The latest frontend build uploaded the frontend-dist artifact for PR #1159. Use the VS Code button below to open this PR with GitHub Artifacts Explorer and browse the built HTML locally.

VS Code: Open PR #1159 artifacts

This comment updates automatically when a new frontend build artifact is uploaded.

@aspire-repo-bot aspire-repo-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated wording suggestions from the forbidden-words check. Apply the suggestions to resolve them.

const horizontalWhitespace = String.raw`[ \t]+`;

// A deprecated term only matches when it isn't fused to an adjacent alphanumeric
// character, so longer tokens like `ASP.NET Aspire` or `.NET AspireX` stay intact

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use "Aspire" instead of ".NET Aspire".

Suggested change
// character, so longer tokens like `ASP.NET Aspire` or `.NET AspireX` stay intact
// character, so longer tokens like `ASPAspire` or `AspireX` stay intact

const termEnd = String.raw`(?![A-Za-z0-9])`;

// Markdown emphasis/link openers can sit between an article and a term in raw
// README content (e.g. `a **.NET Aspire**`, `a [.NET Aspire](url)`, or

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use "Aspire" instead of ".NET Aspire".

Suggested change
// README content (e.g. `a **.NET Aspire**`, `a [.NET Aspire](url)`, or
// README content (e.g. `a **Aspire**`, `a [Aspire](url)`, or


// Markdown emphasis/link openers can sit between an article and a term in raw
// README content (e.g. `a **.NET Aspire**`, `a [.NET Aspire](url)`, or
// `a _.NET Aspire_`), so the article corrector consumes them to stay grammatical

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use "Aspire" instead of ".NET Aspire".

Suggested change
// `a _.NET Aspire_`), so the article corrector consumes them to stay grammatical
// `a _Aspire_`), so the article corrector consumes them to stay grammatical

const markdownOpeners = String.raw`[*\[_]*`;

// Fenced code blocks and inline code spans are copied through verbatim so sample
// commands like `dotnet aspire run` are never rewritten into an unrunnable

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use "Aspire" instead of "dotnet aspire".

Suggested change
// commands like `dotnet aspire run` are never rewritten into an unrunnable
// commands like `Aspire run` are never rewritten into an unrunnable

* Case-insensitive regex source matching the deprecated term core, without
* boundaries. Use `${horizontalWhitespace}` for internal spaces; alphanumeric
* boundaries are applied automatically so a rule can never corrupt a longer
* token like `ASP.NET Aspire` or `.NET AspireX`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use "Aspire" instead of ".NET Aspire".

Suggested change
* token like `ASP.NET Aspire` or `.NET AspireX`.
* token like `ASPAspire` or `AspireX`.

/**
* Indefinite article the replacement should take. Set this only when the
* replacement's leading sound differs from the term's, so a preceding `a`/`an`
* is corrected (e.g. `a .NET Aspire` -> `an Aspire`).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use "Aspire" instead of ".NET Aspire".

Suggested change
* is corrected (e.g. `a .NET Aspire` -> `an Aspire`).
* is corrected (e.g. `a Aspire` -> `an Aspire`).

seoTitle: Bun integration for Aspire AppHost (Community Toolkit)
description: Learn how to use the Aspire Community Toolkit Bun hosting integration to orchestrate Bun applications alongside other resources in the Aspire app host.
seoTitle: Bun integration for Aspire AppHost
description: Learn how to use the Aspire.Hosting.JavaScript Bun hosting APIs to orchestrate Bun applications alongside other resources in the Aspire app host.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use "AppHost" instead of "app host".

Suggested change
description: Learn how to use the Aspire.Hosting.JavaScript Bun hosting APIs to orchestrate Bun applications alongside other resources in the Aspire app host.
description: Learn how to use the Aspire.Hosting.JavaScript Bun hosting APIs to orchestrate Bun applications alongside other resources in the Aspire AppHost.

['uppercase article', `A ${legacyDotnetAspireName} sample`, 'An Aspire sample'],
['lowercase article', `Build a ${legacyDotnetAspireName} sample`, 'Build an Aspire sample'],
['no article', `Deploy the ${legacyDotnetAspireName} app`, 'Deploy the Aspire app'],
])('normalizes the "dotnet aspire" spelling (%s)', (_scenario, input, expected) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use "Aspire" instead of "dotnet aspire".

Suggested change
])('normalizes the "dotnet aspire" spelling (%s)', (_scenario, input, expected) => {
])('normalizes the "Aspire" spelling (%s)', (_scenario, input, expected) => {

test('normalizes prose while preserving adjacent code', () => {
const input = `Build a ${legacyAspireName} app, then run \`${legacyDotnetAspireName} run\`.`;
expect(normalizeAspireTerminology(input)).toBe(
'Build an Aspire app, then run `dotnet aspire run`.'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use "Aspire" instead of "dotnet aspire".

Suggested change
'Build an Aspire app, then run `dotnet aspire run`.'
'Build an Aspire app, then run `Aspire run`.'

@IEvangelist David Pine (IEvangelist) added the ci:skip-forbidden-words Allows maintainers to bypass false positives in the forbidden-word check. label Aug 7, 2026
MongoDB replica set support is not shipped, so this PR intentionally contains no file changes.

Co-authored-by: Copilot App <[email protected]>
@IEvangelist David Pine (IEvangelist) removed the ci:skip-forbidden-words Allows maintainers to bypass false positives in the forbidden-word check. label Aug 7, 2026
@IEvangelist
David Pine (IEvangelist) force-pushed the copilot/update-documentation-mongodb-replica-set branch from c214bd4 to 1dde7ef Compare August 7, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MongoDB Replica set support - needs documentation update

4 participants