mongo-csharp-driver / Specifications
AGENTS.md3.2k starsChanged 4 months agoApache-2.0View on GitHub
JSON-driven runners for the cross-driver test suite. The JSON test files mirror those at https://github.com/mongodb/specifications and are embedded as project resources; the C# code in this directory wires them up to xUnit. Many spec areas have both legacy and unified subdirectories during the migration window; new tests should land in unified.
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.
- AGENTS.mdAGENTS.md
- 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
- 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
1 rule. About 0 are common, 0 are distinctive, and 1 is 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.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 42
Run locally; resolve skips by either fixing the implementation or adding a justified entry to the __ignoredTests / __ignoredTestFiles …
≈ “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
Specifications — AGENTS.md
JSON-driven runners for the cross-driver test suite. The JSON test files mirror those at https://github.com/mongodb/specifications and are embedded as project resources; the C# code in this directory wires them up to xUnit.
Two formats
- Legacy v1 — older style. Three things to know:
- Base-class variance. Some legacy runners extend
LoggableTestClass(e.g. CRUD, InWindow,connection-string/ConnectionStringTestRunner); others are plain xUnit[Theory]classes with no shared base (e.g.AuthTestRunner,ServerSelectionTestRunner,BsonCorpusTestRunner, theread-write-concern/ConnectionStringTestRunner). Note the asymmetry across the twoConnectionStringTestRunnerfiles: the one underconnection-string/extendsLoggableTestClass, the one underread-write-concern/does not. Don't assume a shared base — check the file. All of them pair with a customJsonDrivenTestCaseFactoryfor resource discovery. MongoClientJsonDrivenTestRunnerBaseis a heavier shared base; in this repo onlyClientSideEncryptionTestRunnerderives from it. It adds resource matching,runOn/minServerVersion/maxServerVersionfiltering, EventCapturer setup, FailPoint cleanup, lifecycle. Not used by other legacy runners.- Path-prefix property naming is inconsistent across runners. Most legacy runners override a singular
PathPrefixproperty (e.g.AuthTestRunner,BsonCorpusTestRunner,ClientSideEncryptionTestRunner, the SDAM / CMAP runners), while a few override the pluralPathPrefixes(e.g.CrudTestRunner,server-selection/ServerSelectionTestRunner,server-selection/InWindowTestRunner,connection-string/ConnectionStringTestRunner, theclient-side-encryption/prose-tests/ClientEncryptionProseTests). Check the runner's existing override before adding a new resource namespace — guessing the wrong name yields zero tests discovered. - Resource-suffix variance. Spec-specific: CRUD uses
MongoDB.Driver.Tests.Specifications.crud.tests.v1(with the.v1segment), while many other legacy runners use just…testswith no.v1segment.
- Base-class variance. Some legacy runners extend
- Unified Test Format (UTF) — newer; preferred for new specs. Discovered via
[UnifiedTestsTheory(...)]methods on theUnifiedTestSpecRunnerclass (one class with many theory methods, not one class per spec). TheUnifiedTestsDiscovererreads UTF JSON files from embedded-resource namespaces and instantiates xUnit cases.- Resource-namespace gotcha: upstream spec resource paths use hyphens (
change-streams/,retryable-reads/,client-side-operations-timeout/); not every hyphenated form has a matching on-disk folder underSpecifications/(e.g. there is noclient-side-operations-timeout/directory, the embedded-resource namespace exists nonetheless). Because C# resource names follow identifier rules, hyphens become underscores in the namespace — e.g.change_streams.tests.unified,retryable_reads.tests.unified,client_side_operations_timeout.tests. A handful also drop the.unifiedsuffix entirely (sessions.tests,versioned_api.tests). Cross-check the[UnifiedTestsTheory(...)]argument against the actual embedded-resource list when you add a spec.
- Resource-namespace gotcha: upstream spec resource paths use hyphens (
Many spec areas have both legacy and unified subdirectories during the migration window; new tests should land in unified.
Layout
Runner/— contains onlyMongoClientJsonDrivenTestRunnerBase. Handles schema validation,runOn/minServerVersion/maxServerVersionfiltering, EventCapturer setup, FailPoint cleanup, lifecycle. Its resource-matching property is the singularPathPrefix(overridden byClientSideEncryptionTestRunner).tests/MongoDB.Driver.Tests/UnifiedTestOperations/(sibling of this directory, not a subdirectory) — ~100+ operation classes implementing one ofIUnifiedTestOperation,IUnifiedEntityTestOperation,IUnifiedSpecialTestOperation, orIUnifiedOperationWithCreateAndRunOperationCallback(e.g.,UnifiedAggregateOperation,UnifiedClientBulkWriteOperation,UnifiedAssertEventCountOperation). New operations land there with matchers in theMatchers/subdirectory.- One subdirectory per spec area. The on-disk list grows over time and is the authoritative source —
ls tests/MongoDB.Driver.Tests/Specifications/is the only reliable enumeration. A few representative entries (not exhaustive):crud/,server-discovery-and-monitoring/,connection-monitoring-and-pooling/,client-side-encryption/,change-streams/,auth/, plus the prose-only folderstransactions/,sessions/,retryable-reads/,retryable-writes/(called out separately in the next bullet).- Prose-only C# folders. For
transactions/,sessions/,retryable-reads/, andretryable-writes/, the C# classes in those folders are prose-only — they hold only spec-prose tests written as ordinary xUnit, not a JSON runner class. - Where their JSON cases live. The JSON-driven UTF cases for the same specs sit in
tests/...JSON files under the same folders and are consumed via their embedded-resource namespaces (sessions.tests,transactions.tests.unified, …) byUnifiedTestSpecRunnervia[UnifiedTestsTheory(...)], not by a per-folder runner class. There is no duplication — the same files back both the on-disk path and the embedded-resource lookup.
- Prose-only C# folders. For
Adding a new spec test
- Pull the JSON test files from
mongodb/specifications. - Drop the JSON files into the matching spec subdirectory:
- Location: under the repo-root
specifications/tree (<repo-root>/specifications/<spec-name>/tests/...), not undertests/MongoDB.Driver.Tests/Specifications/. The C# subdirectories here hold the runner classes (and any prose tests); the JSON test corpus is sibling to the C# tree at the repo root. - How the project picks them up:
MongoDB.Driver.Tests.csprojcontains a single repo-wide<EmbeddedResource LinkBase="Specifications\" Include="..\..\specifications\**\*.json" />glob. If your new files live under that repo-root tree, they are already included — no per-spec<EmbeddedResource>edits needed. git addis mandatory. The<EmbeddedResource>glob is evaluated at build time against files on disk regardless of git state, so an unstaged file builds locally and silently disappears in CI (which checks out only what's tracked). Verify by runningdotnet buildand checking the test count.- On-disk layout varies by spec. Some files land at
tests/, others attests/v1/ortests/unified/, and a few use spec-specific subfolders. What matters is that the resulting embedded-resource namespace matches what the runner consumes.
- Location: under the repo-root
- For legacy specs: confirm the runner's
PathPrefix/PathPrefixesoverride (whichever it uses — see the note in "Two formats" above) covers the new resource namespace. - For UTF specs: confirm the
[UnifiedTestsTheory(...)]argument on the test method matches the resource namespace. If the spec uses an operation not yet implemented, add anIUnifiedTestOperation(or related interface) undertests/MongoDB.Driver.Tests/UnifiedTestOperations/and wire it intoUnifiedTestOperationFactory.CreateOperation— that class is the centralized dispatcher (a nestedswitchovertargetEntityIdthenoperationName) that the unified runner consults viaUnifiedEntityMap. An operation class with no entry in this factory is unreachable from JSON test cases. - Run locally; resolve skips by either fixing the implementation or adding a justified entry to the
__ignoredTests/__ignoredTestFilesHashSet<string>statics onUnifiedTestSpecRunneritself (a single class hosts every UTF theory method, so the ignore lists are central, not per-spec).
Skip / ignore patterns
- Legacy — JSON
skipReason,runOn,minServerVersion,maxServerVersionhonored by the runner. - UTF — discovery-time exclusion.
UnifiedTestsDiscovererreads staticHashSet<string>members onUnifiedTestSpecRunner(the single class hosting every UTF theory method) to exclude cases before xUnit instantiates them.- The defaults are
__ignoredTestsand__ignoredTestFiles. - Each
[UnifiedTestsTheory]can override them via theSkippedTestsProvider/SkippedFilesProvidernamed arguments. The attribute is co-located with the discoverer undertests/MongoDB.Driver.Tests/UnifiedTestOperations/. - Consequence: a theory pointed at a different
HashSet<string>static won't be filtered by the default__ignoredTests.
- The defaults are
- UTF — runtime skip.
SkipNotSupportedTestCasesonUnifiedTestSpecRunner(tests/MongoDB.Driver.Tests/Specifications/UnifiedTestSpecRunner.cs) throwsSkipExceptionper case while the runner walks the JSON — the inline mechanism, separate from the discovery-time exclusion above.
Common pitfalls
- Resource path mismatch — a forgotten
<EmbeddedResource>glob or a wrong namespace prefix yields zero tests discovered. Always verify by checking the test count after adding. - Cross-test FailPoint leakage — fail-points are server-global. If a test fails before its
FailPoint.Dispose(), the server stays mis-configured for the next test. Always wrap fail-points inusing. - Unsupported operations masquerade as failures, not skips. If a JSON operation isn't yet wired in
UnifiedTestOperations/, the test errors out with a confusing "operation X not found". Add the operation or the skip entry. - Server version drift — the C# driver targets specific spec revisions. After a sync from upstream, expect breakage on operations the driver hasn't yet caught up to.
runOnconstraints can silently skip whole files when the local server is the wrong version/topology. Read the skip output rather than trusting "all green".- Tests cannot run in parallel — root
AGENTS.mdrule. Spec tests share server state heavily; running in parallel corrupts results.
How to run
# Whole suite (slow; full integration)
dotnet test tests/MongoDB.Driver.Tests/MongoDB.Driver.Tests.csproj -f net10.0 \
--filter "FullyQualifiedName~Specifications"
# One spec area
dotnet test tests/MongoDB.Driver.Tests/MongoDB.Driver.Tests.csproj -f net10.0 \
--filter "FullyQualifiedName~Specifications.crud"Some areas require env vars — see the table in the root AGENTS.md (CSFLE, search, auth mechanisms, X.509, SOCKS5 …). If a required env var is missing, the runner skips silently. If you need that area, stop and ask the user rather than working around the skip.
Boundaries
- vs
tests/MongoDB.Driver.TestHelpers/. This area owns the spec-specific runners and operations; reusable fixtures, mocks, and common helpers live in TestHelpers. - vs each
src/area. A spec runner pulls in code from many functional areas; spec-conformance reviewer cross-cuts them all. When a spec test fails, the relevant area's reviewer often owns the fix — but the spec-conformance reviewer owns the runner and the JSON sync.
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.

