mongo-csharp-driver
AGENTS.md3.2k starsChanged 4 months agoApache-2.0View on GitHub
The driver follows strict semantic versioning: breaking changes to the public surface require a major-version bump. Breaks are always measured against the latest released version of the assembly (the most recent published NuGet package), not against the current state of main. A public API that was added and then changed or removed within the current unreleased development cycle never shipped, so it is not a break. Releases are tagged v<major>.<minor>.<patch> (e.g. v3.9.0). Find the baseline with the GitHub release list,…
Trending
Quiet since September.about the whole repository
Who's talking about mongodb/mongo-csharp-driver
- jbogard/MongoDB.Driver.Core.Extensions.DiagnosticSources“Support for latest MongoDB library with signing”GitHub · Jul 28, 2024 · 13 reactions
- opensearch-project/opensearch-net“[FEATURE] Add LINQ Support to the OpenSearch C# Client”GitHub · Sep 18, 2023 · 5 reactions
- nopSolutions/nopCommerce“MongoDB database support”GitHub · Apr 30, 2019 · 4 reactions
- microsoft/aspire“MongoDB.Driver v3 breaks Aspire.MongoDB.Driver integration”GitHub · Oct 18, 2024 · 3 reactions
- jbogard/MongoDB.Driver.Core.Extensions.DiagnosticSources“Deprecate this package”GitHub · Apr 21, 2026 · 2 reactions
The biggest 5 of 40 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 40
Talked about on GitHub (40 times).
On GitHub · 40
- Jul 28, 2024Support for latest MongoDB library with signing — jbogard/MongoDB.Driver.Core.Extensions.DiagnosticSources13 reactions · 5 comments
- Sep 18, 2023[FEATURE] Add LINQ Support to the OpenSearch C# Client — opensearch-project/opensearch-net5 reactions · 1 comment
- Apr 30, 2019MongoDB database support — nopSolutions/nopCommerce4 reactions · 24 comments
- Oct 18, 2024MongoDB.Driver v3 breaks Aspire.MongoDB.Driver integration — microsoft/aspire3 reactions · 9 comments
- Apr 21, 2026Deprecate this package — jbogard/MongoDB.Driver.Core.Extensions.DiagnosticSources2 reactions · 1 comment
35 more on GitHub
- Nov 5, 2025Corrected Membership Session Handling — OrleansContrib/Orleans.Providers.MongoDB2 reactions · 2 comments
- Jun 4, 2016Support .NET Core — tugberkugurlu/AspNetCore.Identity.MongoDB2 reactions · 1 comment
- Jul 12, 2026Upgrade MongoDB.Driver to 3.9.0 to fix Snappier and SharpCompress vulnerabilities — madelson/DistributedLock1 reaction
- May 28, 2026Upgrade MongoDB.Driver to 3.9.0 — abpframework/abp1 reaction · 1 comment
- May 12, 2026Upgrade MongoDB.Driver to 3.8.1 — abpframework/abp1 reaction
- Mar 19, 2026bump MongoDB.Driver to 3.7.1 — abpframework/abp1 reaction
- Jan 18, 2026Update MongoDB.Driver package version to 3.6.0 — abpframework/abp1 reaction · 1 comment
- Nov 20, 2025Update MongoDB.Driver to version 3.5.1 — abpframework/abp1 reaction
- Jan 30, 2023Hangfire.Mongo is incompatible with the MongoDB.Driver LINQ3 provider — gottscj/Hangfire.Mongo1 reaction · 1 comment
- Jun 6, 2022Mongo Driver Compatibility — alirezanet/Gridify1 reaction · 3 comments
- Mar 31, 2015Support for 2.0 async driver — RobThree/MongoRepository1 reaction · 35 comments
- Sep 29, 2026Bump MongoDB.Driver from 2.11.5 to 2.19.0 — ramonaoldf/run-devops0 reactions
- Sep 15, 2026Bump the nuget group with 1 update — ApurvSinghal/ApurvXam0 reactions
- Aug 2, 2026Bump MongoDB.Driver from 2.8.1 to 2.19.0 — mohaom/TailwindTraders-Website0 reactions
- Jan 12, 2025Bump MongoDB.Driver from 2.14.1 to 2.19.0 in /src/Infrastructure — vigovlugt/LeagueOfItemsBackend0 reactions
- Aug 6, 2024Update dependency MongoDB.Driver to 2.19.0 [SECURITY] — MrDariusAD/DynamicFilter0 reactions
- Aug 6, 2024Update dependency MongoDB.Driver to 2.12.2 [SECURITY] — ShamKarthikS-Hexaware/recicd0 reactions
- Aug 6, 2024Update dependency MongoDB.Driver to 2.12.2 [SECURITY] — MrDariusAD/GirlfriendAdventskalender0 reactions
- Jan 15, 2024Bump MongoDB.Driver.Core and MongoDB.Bson — kravvya/GardenLog.V20230 reactions
- Nov 17, 2023build(deps): bump MongoDb_Version from 2.19.0 to 2.22.0 — AntonioFalcaoJr/EventualShop0 reactions
- Mar 28, 2023Bump MongoDB.Driver from 2.19.0 to 2.19.1 — eincioch/dotnet-microservices-boilerplate0 reactions
- Mar 27, 2023Bump MongoDB.Driver from 2.19.0 to 2.19.1 — niaz-ali-khan/microservise0 reactions
- Mar 3, 2023Bump MongoDB.Driver from 2.13.1 to 2.19.0 in /DotNet/POC/DatabaseBenchmark — AdamNagy/Nadam.Tryouts0 reactions
- Mar 3, 2023Bump MongoDB.Driver from 2.12.3 to 2.19.0 in /Esiur.Stores.MongoDB — esiur/esiur-dotnet0 reactions
- Oct 17, 2022Bump MongoDB.Driver from 2.17.1 to 2.18.0 in /src/backend — ScottishTapWater/OrderBook0 reactions
- Oct 17, 2022fix(deps): bump MongoDB.Driver from 2.16.1 to 2.18.0 — Manu0912/doppler-push-contact0 reactions
- Oct 17, 2022Bump MongoDB.Driver from 2.13.0 to 2.18.0 — uruk-project/uruk-server0 reactions
- Oct 17, 2022Bump MongoDB.Driver from 2.15.1 to 2.18.0 — joelbyford/ApiPatternsClient0 reactions
- Oct 14, 2022Bump MongoDB.Driver from 2.13.1 to 2.18.0 in /examples/AspNetCoreMvc — brucehu123/opentelemetry-dotnet-instrumentation0 reactions
- Oct 14, 2022Bump MongoDB.Driver from 2.12.4 to 2.18.0 in /services/common/Platform.Common — frogsbreath-games/eucre0 reactions
- Oct 14, 2022Bump MongoDB.Driver from 2.12.4 to 2.18.0 in /services/lobby/Platform.Lobby.Tests — frogsbreath-games/eucre0 reactions
- Oct 14, 2022Bump MongoDB.Driver from 2.12.4 to 2.18.0 in /services/eucre-game/Games.Eucre.Api — frogsbreath-games/eucre0 reactions
- Oct 14, 2022Bump MongoDB.Driver from 2.12.4 to 2.18.0 in /services/weather/Weather.Api — frogsbreath-games/eucre0 reactions
- Oct 14, 2022Bump MongoDB.Driver from 2.12.4 to 2.18.0 in /services/library/Platform.Library.Api — frogsbreath-games/eucre0 reactions
- May 24, 2022Bump MongoDB.Driver from 2.13.1 to 2.15.1 in /examples/AspNetCoreMvc — brucehu123/opentelemetry-dotnet-instrumentation0 reactions
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository35 other files it gives its agents.
- src/MongoDB.Bson/AGENTS.mdAGENTS.md
- src/MongoDB.Driver/AGENTS.mdAGENTS.md
- src/MongoDB.Driver/Authentication/AGENTS.mdAGENTS.md
- src/MongoDB.Driver.Authentication.AWS/AGENTS.mdAGENTS.md
- src/MongoDB.Driver/Core/AGENTS.mdAGENTS.md
- src/MongoDB.Driver/Core/Bindings/AGENTS.mdAGENTS.md
- src/MongoDB.Driver/Core/Events/AGENTS.mdAGENTS.md
- src/MongoDB.Driver/Core/Logging/AGENTS.mdAGENTS.md
- src/MongoDB.Driver/Core/Operations/AGENTS.mdAGENTS.md
- src/MongoDB.Driver.Encryption/AGENTS.mdAGENTS.md
- src/MongoDB.Driver/Encryption/AGENTS.mdAGENTS.md
- src/MongoDB.Driver/GeoJsonObjectModel/AGENTS.mdAGENTS.md
- src/MongoDB.Driver/GridFS/AGENTS.mdAGENTS.md
- src/MongoDB.Driver/Linq/AGENTS.mdAGENTS.md
- src/MongoDB.Driver/Search/AGENTS.mdAGENTS.md
- tests/MongoDB.Driver.TestHelpers/AGENTS.mdAGENTS.md
- tests/MongoDB.Driver.Tests/Specifications/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- src/MongoDB.Bson/CLAUDE.mdCLAUDE.md
- src/MongoDB.Driver.Authentication.AWS/CLAUDE.mdCLAUDE.md
- src/MongoDB.Driver/Authentication/CLAUDE.mdCLAUDE.md
- src/MongoDB.Driver/CLAUDE.mdCLAUDE.md
- src/MongoDB.Driver/Core/Bindings/CLAUDE.mdCLAUDE.md
- src/MongoDB.Driver/Core/CLAUDE.mdCLAUDE.md
- src/MongoDB.Driver/Core/Events/CLAUDE.mdCLAUDE.md
- src/MongoDB.Driver/Core/Logging/CLAUDE.mdCLAUDE.md
- src/MongoDB.Driver/Core/Operations/CLAUDE.mdCLAUDE.md
- src/MongoDB.Driver.Encryption/CLAUDE.mdCLAUDE.md
- src/MongoDB.Driver/Encryption/CLAUDE.mdCLAUDE.md
- src/MongoDB.Driver/GeoJsonObjectModel/CLAUDE.mdCLAUDE.md
- src/MongoDB.Driver/GridFS/CLAUDE.mdCLAUDE.md
- src/MongoDB.Driver/Linq/CLAUDE.mdCLAUDE.md
- src/MongoDB.Driver/Search/CLAUDE.mdCLAUDE.md
- tests/MongoDB.Driver.TestHelpers/CLAUDE.mdCLAUDE.md
- tests/MongoDB.Driver.Tests/Specifications/CLAUDE.mdCLAUDE.md
The file
We split this AGENTS.md into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 44
ConfigureAwait(false): All library awaits use ConfigureAwait(false). - Very specific: line 49
Run all tests: dotnet test tests/MongoDB.Driver.Tests/MongoDB.Driver.Tests.csproj -f net10.0
- Very specific: line 50
Run a single test class: dotnet test tests/MongoDB.Driver.Tests/MongoDB.Driver.Tests.csproj -f net10.0 --filter …
- Very specific: line 110
When /review-areas is invoked with a PR number, an additional reviewer runs alongside the others:
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md - CSharpDriver
Overview
The C# driver for MongoDB.
Tech Stack
- .NET library projects producing NuGet packages
- Multi-targeted to
net472,net6.0,net8.0, andnet10.0(seesrc/Directory.Build.props) - xUnit + FluentAssertions for testing
Project Structure
src/MongoDB.Bson/- BSON for MongoDBsrc/MongoDB.Driver/- C# driver for MongoDBsrc/MongoDB.Driver.Encryption/- Client encryption (CSFLE with KMS).src/MongoDB.Driver.Authentication.AWS/- AWS IAM authenticationtests/MongoDB.Driver.Tests/- Main C# driver teststests/MongoDB.Bson.Tests/- BSON handling teststests/*/TestHelpers- Common test utilitiestests/*- Specialized tests; less commontests/MongoDB.Driver.Tests/Specifications/are JSON-driven tests using a common runner.
Editing
- Be careful to preserve file BOMs.
Versioning conventions
The driver follows strict semantic versioning: breaking changes to the public surface require a major-version bump. Breaks are always measured against the latest released version of the assembly (the most recent published NuGet package), not against the current state of main. A public API that was added and then changed or removed within the current unreleased development cycle never shipped, so it is not a break.
Releases are tagged v<major>.<minor>.<patch> (e.g. v3.9.0). Find the baseline with the GitHub release list, not local git tag (a clone's tags are frequently stale and miss recent releases):
- Absolute latest published version:
gh release list --limit 1 --json tagName,isLatest. - A specific major's latest line: the highest
v<major>.*fromgh release list --limit 100 --json tagName.
Diff the file at that release tag against the working tree to confirm a change is observable to an upgrading consumer (git fetch --tags first if the tag isn't local, then git show <tag>:<path>).
What counts as a break: public signature / default / visibility changes; an interface member added to any public interface (the driver multi-targets net472, which can't consume default interface methods, so this is a hard break); behavior changes on an unchanged public signature; behavior changes affecting serialized BSON shape (element name, representation, discriminator, Guid representation).
What does not count as a break:
- Changes to anything
internal— regardless ofInternalsVisibleTo(which exists only to expose internals to first-party test/benchmark assemblies and Moq's proxy stub). Internal code is never part of the public surface. - Changes to the exception type thrown for an unsupported feature (a not-yet-implemented LINQ operator, an unsupported mapping, a guard rejecting something the driver doesn't support). Only the exception type of a supported, documented operation is part of the contract.
Async conventions
- Paired sync/async public surface. Public methods that perform I/O come in pairs: a sync method (
Foo) and an async counterpart (FooAsync) that accepts aCancellationToken. When adding, changing, or[Obsolete]-marking either side, do the same to the other. Operations undersrc/MongoDB.Driver/Core/Operations/duplicate this pairing internally (Execute/ExecuteAsync) — bug fixes must land on both paths; do not collapse them by callingTask.Delay(...).GetAwaiter().GetResult()or similar sync-over-async shortcuts. ConfigureAwait(false). All libraryawaits useConfigureAwait(false); the driver does not assume a synchronization context. Application code calling the driver may use whatever it likes.- Cancellation / CSOT propagation.
CancellationTokenandOperationContext(theCancellationToken+ deadline bundle threaded throughCore/Operations/and the wire layer) must be passed through unchanged. Substituting a freshOperationContextor passingCancellationToken.Nonemid-stack drops the caller's deadline — see the discussion insrc/MongoDB.Driver/Core/AGENTS.mdandsrc/MongoDB.Driver/Core/Operations/AGENTS.md.
Commands
- Build:
dotnet build CSharpDriver.sln - Run all tests:
dotnet test tests/MongoDB.Driver.Tests/MongoDB.Driver.Tests.csproj -f net10.0 - Run a single test class:
dotnet test tests/MongoDB.Driver.Tests/MongoDB.Driver.Tests.csproj -f net10.0 --filter "FullyQualifiedName~ClassName"
Testing
- Tests cannot be run in parallel.
- A MongoDB connection is always available locally, so "integration" tests can be run as well as unit tests. Some test suites also require additional environment variables — if you need to run those tests and the variables are not set, stop and tell the user which variables are needed rather than working around it.
| Feature area | Required environment variables |
| Atlas Search | ATLAS_SEARCH_TESTS_ENABLED, ATLAS_SEARCH_URI |
| CSFLE / auto-encryption | CRYPT_SHARED_LIB_PATH |
| CSFLE with KMS mock servers | KMS_MOCK_SERVERS_ENABLED |
| CSFLE with AWS KMS | CSFLE_AWS_TEMPORARY_CREDS_ENABLED |
| CSFLE with Azure KMS | CSFLE_AZURE_KMS_TESTS_ENABLED |
| CSFLE with GCP KMS | CSFLE_GCP_KMS_TESTS_ENABLED |
| AWS authentication | AWS_TESTS_ENABLED |
| GSSAPI / Kerberos | GSSAPI_TESTS_ENABLED, AUTH_HOST, AUTH_GSSAPI |
| OIDC authentication | OIDC_ENV |
| X.509 authentication | MONGO_X509_CLIENT_CERTIFICATE_PATH, MONGO_X509_CLIENT_CERTIFICATE_PASSWORD |
| PLAIN authentication | PLAIN_AUTH_TESTS_ENABLED |
| SOCKS5 proxy | SOCKS5_PROXY_SERVERS_ENABLED |
Commit and PR Conventions
- The first commit message and the PR message start with a JIRA number:
CSHARP-1234: Description - The branch name will usually match the JIRA number:
CSHARP-1234
Functional areas
Each area below has its own AGENTS.md (auto-loaded when working in that subtree) and a corresponding read-only reviewer subagent in .claude/agents/.
| Area | Location | Reviewer |
| BSON & Serialization | src/MongoDB.Bson/AGENTS.md | bson-reviewer |
| Connection & Transport (SDAM) | src/MongoDB.Driver/Core/AGENTS.md | transport-reviewer |
| Operations, Sessions & Transactions | src/MongoDB.Driver/Core/Operations/AGENTS.md | operations-reviewer |
| Authentication | src/MongoDB.Driver/Authentication/AGENTS.md (+ src/MongoDB.Driver.Authentication.AWS/AGENTS.md) | auth-reviewer |
| Public API: client facades & settings | src/MongoDB.Driver/AGENTS.md (router) | client-api-reviewer |
| Public API: CRUD builders DSL | src/MongoDB.Driver/AGENTS.md (router) | builders-reviewer |
| Aggregation & Change Streams | src/MongoDB.Driver/AGENTS.md (router) + Core/Operations/AGENTS.md | aggregation-reviewer |
| LINQ Provider | src/MongoDB.Driver/Linq/AGENTS.md | linq-reviewer |
| GridFS | src/MongoDB.Driver/GridFS/AGENTS.md | gridfs-reviewer |
| Atlas Search & Vector Search | src/MongoDB.Driver/Search/AGENTS.md | search-reviewer |
| Client-Side Encryption (CSFLE / QE) | src/MongoDB.Driver.Encryption/AGENTS.md (+ src/MongoDB.Driver/Encryption/AGENTS.md) | encryption-reviewer |
| Diagnostics: Events | src/MongoDB.Driver/Core/Events/AGENTS.md | diagnostics-reviewer |
| Diagnostics: Logging | src/MongoDB.Driver/Core/Logging/AGENTS.md | diagnostics-reviewer |
| GeoJSON Object Model | src/MongoDB.Driver/GeoJsonObjectModel/AGENTS.md | geojson-reviewer |
| Spec conformance & test infra | tests/MongoDB.Driver.Tests/Specifications/AGENTS.md (+ tests/MongoDB.Driver.TestHelpers/AGENTS.md) | spec-conformance-reviewer |
Cross-cutting reviewers
These reviewers have no per-area AGENTS.md; they apply a single hygiene lens across the whole diff and run on every invocation of the /review-areas skill.
| Concern | Reviewer |
| Security: secrets, TLS/crypto, redaction, deserialization safety | security-reviewer |
| Public API / SemVer | api-stability-reviewer |
| Async/threading hygiene | async-reviewer |
PR-summary reviewer (external PR mode only)
When /review-areas is invoked with a PR number, an additional reviewer runs alongside the others:
| Concern | Reviewer |
| Holistic "what does this PR do, and is it a good change?" — reads the PR body and the full diff | pr-summary-reviewer |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

