Document MongoDB single-node replica set mode in hosting integration guide#1159
Open
Copilot wants to merge 3 commits into
Open
Document MongoDB single-node replica set mode in hosting integration guide#1159Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
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
Contributor
There was a problem hiding this comment.
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
API usage examples (copy/paste)
Connection and runtime behavior notes
WithReplicaSet()defaults tors0and accepts an optional string name override.directConnection=truewhen replica set mode is enabled.