mongo-ruby-driver
AGENTS.md1.4k starsChanged 8 months agoApache-2.0View on GitHub
This is the Ruby driver for the MongoDB database. It provides a Ruby interface for connecting to MongoDB, performing CRUD operations, and managing database connections. The API is standardized across all MongoDB drivers, via the specifications defined in the MongoDB Specifications repository: https://github.com/mongodb/specifications. The driver targets Ruby 2.7+. Do not use syntax or stdlib features unavailable in Ruby 2.7. The project is organized into the following directories: Tests require a running MongoDB instance. Set the URI via the MONGODB_URI environment…
Trending
Quiet since September.about the whole repository
Who's talking about mongodb/mongo-ruby-driver
- phutchins/logstash-input-mongodb“Getting data from system collections”GitHub · Aug 16, 2015 · 2 reactions
- A Hacker News story“Ruby MongoDB driver is now 2-3x faster with Phusion team commits”Hacker News · Sep 13, 2010 · 2 points
- SpringMT/zstd-ruby“symbol lookup error after upgrade to 1.5.1”GitHub · Dec 27, 2021 · 1 reactions
- mongodb/mongoid“Fix error in QueryCache when retrieving a result larger than batch_size from cache”GitHub · Nov 19, 2019 · 1 reactions
- mongoid/moped“Adds support for SCRAM Authentication”GitHub · Mar 31, 2019 · 1 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 · 42
- Aug 16, 2015Getting data from system collections — phutchins/logstash-input-mongodb2 reactions · 6 comments
- Dec 27, 2021symbol lookup error after upgrade to 1.5.1 — SpringMT/zstd-ruby1 reaction · 5 comments
- Nov 19, 2019Fix error in QueryCache when retrieving a result larger than batch_size from cache — mongodb/mongoid1 reaction · 16 comments
- Mar 31, 2019Adds support for SCRAM Authentication — mongoid/moped1 reaction · 1 comment
- Aug 3, 2015connection refused because too many open connections: 819 — mamantoha/mongo-sinatra-admin1 reaction · 1 comment
37 more on GitHub
- Sep 22, 2026Bump the mongo group across 1 directory with 2 updates — alphagov/asset-manager0 reactions · 2 comments
- Sep 21, 2026DRIVERS-3620 Add Performance Implications section to the OpenTelemetry spec — mongodb/specifications0 reactions
- Sep 19, 2026Bump mongo from 2.25.0 to 2.26.0 — jackstevendev/restaurant_platform_api0 reactions
- Sep 19, 2026Bump mongo from 2.25.0 to 2.26.0 — neurosynq/parse-stack-next0 reactions
- Sep 19, 2026Bump mongo from 2.25.0 to 2.26.0 — rambousek/dictio0 reactions
- Sep 17, 2026Bump mongo from 2.25.0 to 2.26.0 in /mongodb/ruby — azureossd/ruby-databases-samples0 reactions
- Sep 15, 2026Bump mongo from 2.23.1 to 2.26.0 in the mongo group across 1 directory — alphagov/asset-manager0 reactions · 3 comments
- Sep 14, 2026Bump mongo from 2.25.0 to 2.26.0 — oxeanbits/graphoid0 reactions
- Sep 14, 2026Bump mongo from 2.25.0 to 2.26.0 — mamantoha/mongo-sinatra-admin0 reactions
- Sep 14, 2026Update mongo requirement from = 2.13.2 to = 2.26.0 — inspec/inspec0 reactions
- Sep 11, 2026Bump mongo from 2.25.0 to 2.26.0 — errbit/errbit0 reactions
- Jul 23, 2026chore(deps): update mongo requirement from = 2.21.3 to = 2.25.0 — inspec/inspec-mongodb-resources0 reactions
- May 21, 2026Bump mongo from 2.23.0 to 2.24.1 — ruby-benchmark/errbit0 reactions · 2 comments
- May 20, 2026Bump mongo from 2.23.0 to 2.24.1 — Ivan-Vakhula07/errbit0 reactions · 1 comment
- Feb 9, 2026chore(deps)(deps): bump mongo from 2.22.0 to 2.23.0 — manelvf/Transboard0 reactions · 1 comment
- Feb 5, 2026Update mongo requirement from = 2.21.3 to = 2.23.0 — inspec/inspec0 reactions · 1 comment
- Feb 4, 2026Bump mongo from 2.22.0 to 2.23.0 — icarosun/pesquisa_climatica0 reactions
- Jan 28, 2026Update mongoid 7.5.4 → 7.6.1 (minor) — CardTapp/mongoidable0 reactions
- Nov 26, 2025Bump mongo from 2.21.3 to 2.22.0 — edwardtsatsu/railsMongo0 reactions
- Nov 25, 2025Bump mongo from 2.21.3 to 2.22.0 — carlosRPDev/invoices_service0 reactions
- Nov 6, 2025Update mongo requirement from = 2.13.2 to = 2.21.3 — tnir/inspec0 reactions
- Aug 20, 2025Bump mongo from 2.21.1 to 2.21.3 — AnSergio/api-rails0 reactions
- May 1, 2025Bump mongo from 2.21.0 to 2.21.1 — errbit-ng/errbit-ng0 reactions
- May 1, 2025Bump mongo from 2.21.0 to 2.21.1 — princekumarg12/mongo-devise-jwt0 reactions
- Oct 6, 2024Update mongo requirement from = 2.13.2 to = 2.21.0 — johnmulder8/inspec0 reactions
- Jan 15, 2024Announce Moped EOL — mongoid/moped0 reactions
- Aug 10, 2023Bump mongo from 2.14.0 to 2.19.1 — alphagov/licence-finder0 reactions
- Dec 13, 2022Bump mongo from 2.13.0 to 2.18.2 — vnepomuceno/kindle-clippings-manager0 reactions
- Dec 13, 2022Bump mongo from 2.14.0 to 2.18.2 — NimbleLabs/CourseApp0 reactions
- Dec 13, 2022chore(deps): bump mongo from 2.14.0 to 2.18.2 — gradybarrett/vivlio0 reactions
- Jul 15, 2021Bump mongo from 2.12.2 to 2.15.0 — stephannv/heylisten.me0 reactions
- Jul 15, 2021Bump mongo from 2.13.0 to 2.15.0 — vnepomuceno/kindle-clippings-manager0 reactions
- Jul 20, 2020Bump mongo from 2.2.4 to 2.10.5 — robertodecurnex/spectro-hive0 reactions
- Jun 25, 2020Bump mongo from 2.4.3 to 2.12.1 — AleksandrZooLZakharov/reddit0 reactions
- Mar 29, 20192.8 stable with fix 1774 — netlify/mongo-ruby-driver0 reactions
- Jul 31, 2014Lower refresh_interval default from 300 to 10 sec — mongoid/moped0 reactions · 3 comments
- Jun 17, 2011Broken after loading moved to Ruby driver — brianhempel/mm-logged-time0 reactions
On Hacker News · 1
- Sep 13, 2010Ruby MongoDB driver is now 2-3x faster with Phusion team commitssays it tested it2 points
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 repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
We split this AGENTS.md into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 31
Run RuboCop after making changes, and always before committing:
- Distinctive: line 47
When writing prose — commit messages, code comments, documentation — be concise, write as a human would, avoid overly complicated …
- Distinctive: line 61
Do not write Ruby specs that duplicate behavior already covered by YAML spec tests.
≈ “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
Project Description
This is the Ruby driver for the MongoDB database. It provides a Ruby interface for connecting to MongoDB, performing CRUD operations, and managing database connections. The API is standardized across all MongoDB drivers, via the specifications defined in the MongoDB Specifications repository: https://github.com/mongodb/specifications. The driver targets Ruby 2.7+. Do not use syntax or stdlib features unavailable in Ruby 2.7.
Project Structure
The project is organized into the following directories:
lib/: the main codebasespec/: RSpec tests for the project, and shared test databin/: executable scriptsexamples/: example usage of the librarygemfiles/: Gemfile files for different usage scenarios (primarily testing, aside fromstandard.rbwhich is used for development and production)profile/: profiling scripts and results
Development Workflow
Running tests
Tests require a running MongoDB instance. Set the URI via the MONGODB_URI environment variable:
MONGODB_URI="mongodb://localhost:27017,localhost:27018,localhost:27019/" bundle exec rspec spec/path/to/spec.rbA replica set is typically available locally at localhost:27017,27018,27019.
Linting
Run RuboCop after making changes, and always before committing:
bundle exec rubocop lib/mongo/changed_file.rb spec/mongo/changed_file_spec.rbPass the specific files you modified.
RuboCop is configured with performance, rake, and rspec plugins (.rubocop.yml).
Commit convention
Prefix commit messages with the JIRA ticket: RUBY-#### Short description. The ticket number is typically in the branch name (e.g., branch 3795-foo means RUBY-3795).
Prose style
When writing prose — commit messages, code comments, documentation — be concise, write as a human would, avoid overly complicated sentences, and use no emojis.
Definition of done
Always run the relevant spec file(s) against the local cluster before considering a task complete. Running tests is not optional. "Relevant" means: the spec file for each class you changed, plus any integration specs in spec/integration/ that exercise the affected feature. If MongoDB is not reachable, report this to the user rather than trying to work around it.
Thread and fiber safety
This driver runs in multi-threaded and multi-fiber environments. When writing or modifying code that touches connection pools, server monitors, or any shared state, always consider concurrent access. Use existing synchronization primitives in the codebase rather than introducing new ones.
Spec fixtures
Unified test format YAML fixtures live in spec/spec_tests/data/<suite_name>/. To add new fixtures, copy YAML files from specifications/source/<spec-name>/tests/unified/ into that directory. The runner loads all *.yml files automatically — no runner changes needed.
Do not write Ruby specs that duplicate behavior already covered by YAML spec tests. New Ruby specs should cover behavior that cannot be expressed in the unified test format.
Code Reviews
See .github/code-review.md for code review guidelines.
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.

