mongo-java-driver
AGENTS.md2.7k starsChanged 7 months agoApache-2.0View on GitHub
All changes require human review. Breaking changes to public API require a major version bump — always warn if binary compatibility is affected. Also consult .AGENTS.md / ~/.AGENTS.md if present for local agent settings. Architecture: Multi-module Gradle project: bson → driver-core → driver-sync/driver-reactive-streams → language wrappers (driver-kotlin-sync, driver-kotlin-coroutine, driver-scala). See .agents/references/project-guide for module structure and dependency graph. Each module has its own AGENTS.md. The default branch is main (not master). Always use main when comparing, diffing, or creating branches. -…
Trending
Quiet since September.about the whole repository
Who's talking about mongodb/mongo-java-driver
- A Hacker News story“Wait, What?”Hacker News · May 30, 2013 · 66 points
- A Hacker News story“If (((_ok)? true: (Math.random() 0.1))) {return res;}”Hacker News · Jan 27, 2016 · 8 points
- A Hacker News story“MongoDB's random exception handling”Hacker News · Jul 20, 2015 · 8 points
- AxonFramework/extension-mongo“MongoDB cursor is not closed in AbstractMongoEventStorageStrategy.findTrackedEvents”GitHub · Apr 2, 2025 · 5 reactions
- scram-sasl/info“State of Play”GitHub · Jul 15, 2019 · 3 reactions
The biggest 5 of 43 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 43
Talked about on GitHub and Hacker News (43 times).
On GitHub · 39
- Apr 2, 2025MongoDB cursor is not closed in AbstractMongoEventStorageStrategy.findTrackedEvents — AxonFramework/extension-mongo5 reactions · 2 comments
- Jul 15, 2019State of Play — scram-sasl/info3 reactions · 8 comments
- Apr 21, 2022Support ObjectId — realm/realm-kotlin2 reactions · 4 comments
- Sep 29, 2026Bump org.mongodb:mongodb-driver-sync from 5.12.0 to 5.13.0 — peco2282/DevCore1 reaction · 1 comment
- Sep 28, 2026build(deps): Bump the gradle-minor-and-patch group with 13 updates — sempods/sempods-kotlin1 reaction · 1 comment
34 more on GitHub
- Sep 21, 2026Bump org.mongodb:mongodb-driver-sync from 5.11.0 to 5.12.0 — peco2282/DevCore1 reaction · 1 comment
- Sep 14, 2026build(deps): Bump the gradle-minor-and-patch group with 9 updates — sempods/sempods-kotlin1 reaction · 1 comment
- Sep 14, 2026Bump org.mongodb:mongodb-driver-sync from 5.11.0 to 5.11.1 — peco2282/DevCore1 reaction · 2 comments
- Sep 1, 2026Bump org.mongodb:mongodb-driver-sync from 5.10.0 to 5.11.0 — peco2282/DevCore1 reaction · 2 comments
- Aug 18, 2026Bump org.mongodb:mongodb-driver-sync from 5.9.2 to 5.10.0 — peco2282/DevCore1 reaction · 1 comment
- Aug 17, 2026Bump org.mongodb:mongodb-driver-sync from 5.9.1 to 5.9.2 — peco2282/DevCore1 reaction · 1 comment
- Jul 23, 2026Bump org.mongodb:mongodb-driver-sync from 5.9.0 to 5.9.1 — peco2282/DevCore1 reaction · 1 comment
- Jul 23, 2026chore(deps): bump org.mongodb:mongodb-driver-sync from 5.6.2 to 5.9.1 — reformcloudapp/reformcloud1 reaction · 1 comment
- Jul 19, 2026Bump the gradle-all group across 1 directory with 9 updates — Satilianius/BsonViewer1 reaction · 1 comment
- Jul 8, 2026chore(deps): bump org.mongodb:mongodb-driver-sync from 5.6.2 to 5.9.0 — reformcloudapp/reformcloud1 reaction · 2 comments
- Jul 7, 2026Bump org.mongodb:mongodb-driver-sync from 5.3.1 to 5.9.0 — peco2282/DevCore1 reaction · 1 comment
- Jul 6, 2026Bump org.mongodb:mongodb-driver-sync from 5.3.1 to 5.8.0 — peco2282/DevCore1 reaction · 2 comments
- Jun 28, 2026Bump the gradle-all group across 1 directory with 8 updates — Satilianius/BsonViewer1 reaction · 2 comments
- Jun 21, 2026Bump the gradle-all group across 1 directory with 7 updates — Satilianius/BsonViewer1 reaction · 2 comments
- Jun 14, 2026Bump the gradle-all group across 1 directory with 5 updates — Satilianius/BsonViewer1 reaction · 2 comments
- Jun 7, 2026Bump the gradle-all group across 1 directory with 4 updates — Satilianius/BsonViewer1 reaction · 2 comments
- May 31, 2026Bump the gradle-all group with 3 updates — Satilianius/BsonViewer1 reaction · 2 comments
- May 29, 2026chore(deps): bump org.mongodb:mongodb-driver-sync from 5.6.2 to 5.8.0 — reformcloudapp/reformcloud1 reaction · 2 comments
- May 27, 2026chore(deps): bump org.mongodb:mongodb-driver-sync from 5.6.2 to 5.7.1 — reformcloudapp/reformcloud1 reaction · 2 comments
- Feb 9, 2026[Bug]: ISODate serialization truncates millisecond precision — GoogleCloudPlatform/DataflowTemplates1 reaction · 2 comments
- Dec 21, 2025Bump the gradle-all group across 1 directory with 4 updates — Satilianius/BsonViewer1 reaction · 1 comment
- Dec 14, 2025Bump the gradle-all group with 3 updates — Satilianius/BsonViewer1 reaction · 2 comments
- Oct 24, 2025Bump the gradle-version-updates group across 1 directory with 24 updates — communitiesuk/eip-ero-print-api1 reaction · 1 comment
- Oct 12, 2025Bump org.mongodb:bson from 5.6.0 to 5.6.1 in the gradle-all group — Satilianius/BsonViewer1 reaction · 1 comment
- Oct 6, 2025Bump org.mongodb:mongodb-driver-sync from 4.11.1 to 5.6.1 — erhebend-tai/Relentless.Extension.11 reaction · 1 comment
- Sep 14, 2025Bump the gradle-all group with 2 updates — Satilianius/BsonViewer1 reaction · 1 comment
- Jul 30, 2025Bump org.mongodb:mongodb-driver-sync from 4.11.1 to 5.5.1 — erhebend-tai/Relentless.Extension.11 reaction · 2 comments
- Jun 9, 2025Bump org.mongodb:bson from 5.5.0 to 5.5.1 — Satilianius/BsonViewer1 reaction · 1 comment
- May 7, 2025Bump org.mongodb:bson from 5.4.0 to 5.5.0 — Satilianius/BsonViewer1 reaction · 1 comment
- Jan 10, 2022Add new instrumentation for MongoDB reactive streams driver 4.8.x+ — newrelic/newrelic-java-agent1 reaction · 10 comments
- May 1, 2026chore(deps): bump org.mongodb:mongodb-driver-sync from 5.6.2 to 5.7.0 — reformcloudapp/reformcloud0 reactions · 2 comments
- Mar 22, 2026Bump the gradle-all group across 1 directory with 8 updates — Satilianius/BsonViewer0 reactions · 2 comments
- Mar 1, 2026Bump the gradle-all group across 1 directory with 7 updates — Satilianius/BsonViewer0 reactions · 2 comments
- Feb 8, 2026Bump the gradle-all group across 1 directory with 6 updates — Satilianius/BsonViewer0 reactions · 2 comments
On Hacker News · 4
- May 30, 2013Wait, What?66 points · 15 comments
- Jan 27, 2016If (((_ok)? true: (Math.random() 0.1))) {return res;}8 points · 3 comments
- Jul 20, 2015MongoDB's random exception handling8 points · 3 comments
- May 30, 2013MongoDB Random?2 points · 3 comments
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 repository41 other files it gives its agents.
- bom/AGENTS.mdAGENTS.md
- bson/AGENTS.mdAGENTS.md
- bson-kotlin/AGENTS.mdAGENTS.md
- bson-kotlinx/AGENTS.mdAGENTS.md
- bson-record-codec/AGENTS.mdAGENTS.md
- bson-scala/AGENTS.mdAGENTS.md
- buildSrc/AGENTS.mdAGENTS.md
- driver-benchmarks/AGENTS.mdAGENTS.md
- driver-core/AGENTS.mdAGENTS.md
- driver-kotlin-coroutine/AGENTS.mdAGENTS.md
- driver-kotlin-extensions/AGENTS.mdAGENTS.md
- driver-kotlin-sync/AGENTS.mdAGENTS.md
- driver-legacy/AGENTS.mdAGENTS.md
- driver-reactive-streams/AGENTS.mdAGENTS.md
- driver-scala/AGENTS.mdAGENTS.md
- driver-sync/AGENTS.mdAGENTS.md
- gradle/AGENTS.mdAGENTS.md
- mongodb-crypt/AGENTS.mdAGENTS.md
- testing/AGENTS.mdAGENTS.md
- bom/CLAUDE.mdCLAUDE.md
- bson/CLAUDE.mdCLAUDE.md
- bson-kotlin/CLAUDE.mdCLAUDE.md
- bson-kotlinx/CLAUDE.mdCLAUDE.md
- bson-record-codec/CLAUDE.mdCLAUDE.md
- bson-scala/CLAUDE.mdCLAUDE.md
- buildSrc/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- driver-benchmarks/CLAUDE.mdCLAUDE.md
- driver-core/CLAUDE.mdCLAUDE.md
- driver-kotlin-coroutine/CLAUDE.mdCLAUDE.md
- driver-kotlin-extensions/CLAUDE.mdCLAUDE.md
- driver-kotlin-sync/CLAUDE.mdCLAUDE.md
- driver-legacy/CLAUDE.mdCLAUDE.md
- driver-reactive-streams/CLAUDE.mdCLAUDE.md
- driver-scala/CLAUDE.mdCLAUDE.md
- driver-sync/CLAUDE.mdCLAUDE.md
- gradle/CLAUDE.mdCLAUDE.md
- mongodb-crypt/CLAUDE.mdCLAUDE.md
- testing/CLAUDE.mdCLAUDE.md
- evergreenSkill
- sync-agents-docsSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
16 rules. About 0 are common, 7 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 3
All changes require human review.
- Distinctive: line 17
Commits: Keep commits logical and reviewable — each commit should be a coherent unit of change
- Very specific: line 18
TODO comments: Must reference a Jira ticket if the work belongs to a different ticket: // TODO JAVA-XXXX reasoning for the todo
- Distinctive: line 23
Read before modifying — understand existing code and patterns first
- Distinctive: line 26
No rewrites without explicit permission
- Distinctive: line 27
When stuck or uncertain: stop, explain, propose alternatives, ask
- Very specific: line 28
When authoring or reviewing changes: consult the relevant .agents/references/ file for each area the changes touch
- Very specific: line 34
Java 8 baseline: no Java 9+ language features unless the module raises sourceCompatibility.
- Very specific: line 48
Do not reformat outside your changes.
- Distinctive: line 54
Every code change must include tests.
- Distinctive: line 55
Do not reduce coverage.
- Very specific: line 66
Nullability: use com.mongodb.lang annotations.
- Very specific: line 69
Secrets: Never render credentials (usernames, passwords, tokens, keys) in toString() — emit <hidden> instead.
- Very specific: line 72
Thread safety: use com.mongodb.annotations (@ThreadSafe / @NotThreadSafe / @Immutable).
- Distinctive: line 98
Never add dependencies without justification
- Very specific: line 99
All dependency versions are managed in gradle/libs.versions.toml — never declare versions inline in build.gradle.kts
≈ “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 - MongoDB Java Driver
All changes require human review.
Breaking changes to public API require a major version bump — always warn if binary compatibility is affected.
Also consult .AGENTS.md / ~/.AGENTS.md if present for local agent settings.
Architecture: Multi-module Gradle project: bson → driver-core → driver-sync/driver-reactive-streams → language wrappers (driver-kotlin-sync, driver-kotlin-coroutine, driver-scala).
See .agents/references/project-guide for module structure and dependency graph.
Each module has its own AGENTS.md.
Git
The default branch is main (not master). Always use main when comparing, diffing, or creating branches.
- Branch naming:
JAVA-XXXXmatching the Jira ticket (e.g.,JAVA-6143) - Commits: Keep commits logical and reviewable — each commit should be a coherent unit of change
- TODO comments: Must reference a Jira ticket if the work belongs to a different ticket:
// TODO JAVA-XXXX reasoning for the todo
Core Rules
- Read before modifying — understand existing code and patterns first
- Minimal changes only — no drive-by refactoring or unrelated changes
- Preserve existing comments — only remove if provably incorrect
- No rewrites without explicit permission
- When stuck or uncertain: stop, explain, propose alternatives, ask
- When authoring or reviewing changes: consult the relevant
.agents/references/file for each area the changes touch
Build
Gradle with Kotlin DSL. Build JDK: 17+. Source baseline: Java 8. Versions in gradle/libs.versions.toml.
- Java 8 baseline: no Java 9+ language features unless the module raises
sourceCompatibility. - Kotlin 1.8 with JVM target 1.8; all Kotlin modules enforce
explicitApi().
Details for both are in .agents/references/style-reference.
./gradlew check # Full validation (format + static checks + tests)
./gradlew :driver-core:test # Single module tests
./gradlew integrationTest -Dorg.mongodb.test.uri="mongodb://localhost:27017"Style
check depends on spotlessApply to auto-fix formatting — run ./gradlew spotlessApply independently when needed.
Do not reformat outside your changes.
See .agents/references/style-reference for prohibited
patterns, required headers, and full formatting rules.
Testing
- Every code change must include tests. Do not reduce coverage.
- Integration tests require a running MongoDB instance (see the test URI in Build section) —
do not attempt to run
integrationTestwithout a configured server. - See
.agents/references/testing-guidefor framework details and running specific tests. - See
.agents/references/spec-testsfor MongoDB specification test conventions.
API
All com.mongodb.internal.* / org.bson.internal.* is private API — never expose in public APIs.
Nullability: use com.mongodb.lang annotations; new packages must declare @NonNullApi in
package-info.java.
Secrets: Never render credentials (usernames, passwords, tokens, keys) in toString() — emit
<hidden> instead.
Thread safety: use com.mongodb.annotations (@ThreadSafe / @NotThreadSafe / @Immutable);
public API classes must be thread-safe unless annotated otherwise.
See .agents/references/api-design for stability annotations,
design principles, and the full nullability and thread safety conventions.
Code Design
Applies to implementation code — internal packages, method bodies, and private or package-access program elements.
See .agents/references/code-design for the rules.
Do Not Modify Without Human Approval
- Wire protocol / authentication handshakes (
com.mongodb.internal.connection) - Connection pool core code (
com.mongodb.internal.connection.pool) - Security-critical encryption code / JNA bindings (
mongodb-crypt) - Public API contracts (breaking changes need major version bump)
- BSON specification compliance
- Spec test data submodule (
testing/resources/specifications/) - Release/versioning scripts,
.evergreen/config, credentials/secrets
See .agents/skills/evergreen for CI validation and patch builds.
Dependencies
- Never add dependencies without justification
- All dependency versions are managed in
gradle/libs.versions.toml— never declare versions inline inbuild.gradle.kts
Before Submitting
./gradlew spotlessApply docs check scalaCheck # formatting + docs + static checks + all testsDoes 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.

