https://github.com/mongodb/mongo-ruby-driver
The Official MongoDB Ruby Driver
https://github.com/mongodb/mongo-ruby-driver
Keywords
mongodb mongodb-driver nosql ruby ruby-on-rails
Keywords from Contributors
activerecord orm-framework activejob mvc rubygems rack sinatra rspec sidekiq background-jobs
Last synced: about 13 hours ago
JSON representation
Repository metadata
The Official MongoDB Ruby Driver
- Host: GitHub
- URL: https://github.com/mongodb/mongo-ruby-driver
- Owner: mongodb
- License: apache-2.0
- Created: 2009-01-15T16:40:45.000Z (almost 17 years ago)
- Default Branch: master
- Last Pushed: 2025-11-27T09:28:47.000Z (12 days ago)
- Last Synced: 2025-11-27T17:13:19.800Z (12 days ago)
- Topics: mongodb, mongodb-driver, nosql, ruby, ruby-on-rails
- Language: Ruby
- Homepage: https://www.mongodb.com/docs/ruby-driver
- Size: 41.7 MB
- Stars: 1,436
- Watchers: 59
- Forks: 533
- Open Issues: 17
- Releases: 178
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Notice: NOTICE
README.md
MongoDB Ruby Driver


The officially supported Ruby driver for MongoDB.
The Ruby driver supports Ruby 2.7-3.3 and JRuby 9.3-9.4.
Installation
Install via RubyGems, either via the command-line for ad-hoc uses:
$ gem install mongo
Or via a Gemfile for more general use:
gem 'mongo'
Release Integrity
Each release of the MongoDB Ruby driver after version 2.20.0 has been automatically built and signed using the team's GPG key.
To verify the driver's gem file:
- Download the GPG key.
- Import the key into your GPG keyring with
gpg --import ruby-driver.asc. - Download the gem file (if you don't already have it). You can download it from RubyGems with
gem fetch mongo, or you can download it from the releases page on GitHub. - Download the corresponding detached signature file from the same release. Look at the bottom of the release that corresponds to the gem file, under the 'Assets' list, for a
.sigfile with the same version number as the gem you wish to install. - Verify the gem with
gpg --verify mongo-X.Y.Z.gem.sig mongo-X.Y.Z.gem(replacingX.Y.Zwith the actual version number).
You are looking for text like "Good signature from "MongoDB Ruby Driver Release Signing Key packaging@mongodb.com" in the output. If you see that, the signature was found to correspond to the given gem file.
(Note that other output, like "This key is not certified with a trusted signature!", is related to web of trust and depends on how strongly you, personally, trust the ruby-driver.asc key that you downloaded from us. To learn more, see https://www.gnupg.org/gph/en/manual/x334.html)
Why not use RubyGems' gem-signing functionality?
RubyGems' own gem signing is problematic, most significantly because there is no established chain of trust related to the keys used to sign gems. RubyGems' own documentation admits that "this method of signing gems is not widely used" (see https://guides.rubygems.org/security/). Discussions about this in the RubyGems community have been off-and-on for more than a decade, and while a solution will eventually arrive, we have settled on using GPG instead for the following reasons:
- Many of the other driver teams at MongoDB are using GPG to sign their product releases. Consistency with the other teams means that we can reuse existing tooling for our own product releases.
- GPG is widely available and has existing tools and procedures for dealing with web of trust (though they are admittedly quite arcane and intimidating to the uninitiated, unfortunately).
Ultimately, most users do not bother to verify gems, and will not be impacted by our choice of GPG over RubyGems' native method.
Documentation
High level documentation and usage examples are located
here.
API documentation for the most recent release can be found
here.
To build API documentation for the master branch, check out the
repository locally and run rake docs.
High-level driver documentation including tutorials and the reference that were in the docs folder can now be found
at the docs-ruby repository, here
Support
Commercial support for the driver is available through the
MongoDB Support Portal.
For questions, discussions or general technical support, please visit the
MongoDB Community Forum.
Please see Technical Support page
in the documentation for other support resources.
Bugs & Feature Requests
To report a bug in the driver or request a feature specific to the Ruby driver:
- Visit our issue tracker and login
(or create an account if you do not have one already). - Navigate to the RUBY project.
- Click 'Create Issue' and fill out all of the applicable form fields.
When creating an issue, please keep in mind that all information in JIRA
for the RUBY project, as well as the core server (the SERVER project),
is publicly visible.
PLEASE DO:
- Provide as much information as possible about the issue.
- Provide detailed steps for reproducing the issue.
- Provide any applicable code snippets, stack traces and log data.
Do not include any sensitive data or server logs. - Specify version numbers of the driver and MongoDB server.
PLEASE DO NOT:
- Provide any sensitive data or server logs.
- Report potential security issues publicly (see 'Security Issues' below).
Security Issues
If you have identified a potential security-related issue in the Ruby driver
(or any other MongoDB product), please report it by following the
instructions here.
Product Feature Requests
To request a feature which is not specific to the Ruby driver, or which
affects more than the driver alone (for example, a feature which requires
MongoDB server support), please submit your idea through the
MongoDB Feedback Forum.
Maintenance and Bug Fix Policy
New driver functionality is generally added in a backwards-compatible manner
and results in new minor driver releases (2.x). Bug fixes are generally made on
master first and are backported to the current minor driver release. Exceptions
may be made on a case-by-case basis, for example security fixes may be
backported to older stable branches. Only the most recent minor driver release
is officially supported. Customers should use the most recent driver release in
their applications.
Running Tests
Please refer to spec/README.md for instructions on how
to run the driver's test suite.
Releases
Full release notes and release history are available on the GitHub releases
page.
The MongoDB Ruby driver follows semantic versioning for its releases.
License
Copyright (C) 2009-2020 MongoDB, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Owner metadata
- Name: mongodb
- Login: mongodb
- Email: iteng@mongodb.com
- Kind: organization
- Description:
- Website: http://www.mongodb.com/
- Location: United States of America
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/45120?v=4
- Repositories: 273
- Last ynced at: 2025-04-05T00:02:27.902Z
- Profile URL: https://github.com/mongodb
GitHub Events
Total
- Release event: 2
- Watch event: 16
- Delete event: 1
- Issue comment event: 8
- Push event: 30
- Pull request review comment event: 10
- Pull request review event: 76
- Pull request event: 73
- Fork event: 10
- Create event: 5
Last Year
- Release event: 2
- Watch event: 13
- Delete event: 1
- Issue comment event: 7
- Push event: 23
- Pull request review event: 65
- Pull request review comment event: 10
- Pull request event: 56
- Fork event: 9
- Create event: 5
Committers metadata
Last synced: about 15 hours ago
Total Commits: 6,633
Total Committers: 203
Avg Commits per committer: 32.675
Development Distribution Score (DDS): 0.793
Commits in past year: 32
Committers in past year: 9
Avg Commits per committer in past year: 3.556
Development Distribution Score (DDS) in past year: 0.594
| Name | Commits | |
|---|---|---|
| Emily | e****y@m****m | 1375 |
| Oleg Pudeyev | 3****o | 964 |
| Durran Jordan | d****n@g****m | 919 |
| Kyle Banker | k****r@g****m | 839 |
| Tyler Brock | t****k@g****m | 373 |
| Mike Dirolf | m****e@1****m | 289 |
| Jim Menard | j****m@1****m | 273 |
| Oleg Pudeyev | o****g@b****m | 271 |
| Dmitry Rybakov | d****v@m****m | 212 |
| Emily Giurleo | e****o@g****m | 151 |
| Neil Shweky | n****y@g****m | 137 |
| Brandon Black | b****k@g****m | 117 |
| Jamis Buck | j****k@m****m | 70 |
| Saghm Rossi | s****i@g****m | 67 |
| Gary Murakami | g****i@1****m | 60 |
| Adrian Madrid | a****m@a****) | 38 |
| Wojciech Piekutowski | w****h@p****t | 34 |
| HanaPearlman | p****a@g****m | 24 |
| Hongli Lai (Phusion) | h****i@p****l | 21 |
| Chris Heald | c****d@g****m | 16 |
| Jonathan Hyman | j****n@p****u | 13 |
| Cyril Mougel | c****l@g****m | 11 |
| Alex Bevilacqua | a****x@a****m | 11 |
| gjchong25 | g****g@s****u | 11 |
| Nelson Elhage | n****e@n****m | 10 |
| Johnny Shields | j****s@g****m | 10 |
| Marco Sandrini | n****e@g****m | 8 |
| Evan Broder | e****n@s****m | 7 |
| Reid Morrison | r****o@g****m | 7 |
| John Nunemaker | n****r@g****m | 6 |
| and 173 more... | ||
Committer domains:
- mongodb.com: 9
- 10gen.com: 9
- me.com: 2
- dimelo.com: 2
- tiscali.cz: 1
- pobox.com: 1
- ideopolis.gr: 1
- redhat.com: 1
- mitre.org: 1
- umich.edu: 1
- mylookout.com: 1
- iterativedesigns.com: 1
- serialssolutions.com: 1
- nleger.com: 1
- dropio.com: 1
- cerner.com: 1
- mellmo.com: 1
- angilly.com: 1
- ismell.org: 1
- ukd1.co.uk: 1
- gymlogr.com: 1
- saybot.com: 1
- develssoftware.com: 1
- songbirdnest.com: 1
- online.ie: 1
- bsdpower.com: 1
- aemtower.(none): 1
- piekutowski.net: 1
- phusion.nl: 1
- post.harvard.edu: 1
- alexbevi.com: 1
- seas.upenn.edu: 1
- nelhage.com: 1
- stripe.com: 1
- schilling.io: 1
- abshere.net: 1
- coswellproductions.com: 1
- epam.com: 1
- floorplanner.com: 1
- fastignite.com: 1
- dio.jp: 1
- io.com: 1
- unixninjas.org: 1
- herimedia.com: 1
- mcgeary.org: 1
- finagle.org: 1
- sema.in: 1
- ucla.edu: 1
- 14lines.com: 1
- mongohq.com: 1
- snowgiraffe.com: 1
- benatkin.com: 1
- state.it: 1
- benburkert.com: 1
- tmm1.net: 1
- alexcoomans.com: 1
- cs.oberlin.edu: 1
- comerford.cc: 1
- ehresman.org: 1
- maski.org: 1
- brightbits.co.uk: 1
- lds.li: 1
- spkdev.net: 1
- suse.de: 1
- wyeworks.com: 1
- tron.name: 1
- joncrosby.me: 1
- braze.com: 1
- thoughtbot.com: 1
- shopify.com: 1
- solisoft.net: 1
- nicholaswyoung.com: 1
- justindossey.com: 1
- hughesorama.com: 1
- solutious.com: 1
- dblock.org: 1
- jmty.jp: 1
- demarque.com: 1
- contextoptional.com: 1
- fullbridge.com: 1
- linkedin.com: 1
- vamosa.com: 1
- xs4all.nl: 1
- jmbp2.datafax.net: 1
- acceletroncorp.com: 1
- codecons.com: 1
- seonic.net: 1
- berther.io: 1
- heli.pet: 1
- aimred.com: 1
- rybakov.eu: 1
- sunlightfoundation.com: 1
- alumni.cmu.edu: 1
- stripey.net: 1
Issue and Pull Request metadata
Last synced: 5 days ago
Total issues: 1
Total pull requests: 430
Average time to close issues: 2 days
Average time to close pull requests: 17 days
Total issue authors: 1
Total pull request authors: 28
Average comments per issue: 0.0
Average comments per pull request: 0.2
Merged pull request: 338
Bot issues: 0
Bot pull requests: 0
Past year issues: 0
Past year pull requests: 71
Past year average time to close issues: N/A
Past year average time to close pull requests: 8 days
Past year issue authors: 0
Past year pull request authors: 13
Past year average comments per issue: 0
Past year average comments per pull request: 0.14
Past year merged pull request: 38
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- jamis (1)
Top Pull Request Authors
- jamis (143)
- comandeo-mongo (84)
- comandeo (78)
- Neilshweky (46)
- alexbevi (10)
- johnnyshields (10)
- jordan-smith721 (7)
- adviti-mishra (6)
- norareidy (5)
- alcaeus (5)
- jteich (4)
- i80and (4)
- p-mongo (4)
- kevinAlbs (2)
- ccho-mongodb (2)
Top Issue Labels
Top Pull Request Labels
- release-candidate (4)
- bug (4)
- incomplete (2)
- feature (2)
Package metadata
- Total packages: 6
-
Total downloads:
- rubygems: 192,820,772 total
- Total docker downloads: 246,669,446
- Total dependent packages: 529 (may contain duplicates)
- Total dependent repositories: 15,850 (may contain duplicates)
- Total versions: 519
- Total maintainers: 4
gem.coop: mongo
A pure-Ruby driver for connecting to, querying, and manipulating MongoDB databases. Officially developed and supported by MongoDB, with love for the Ruby community.
- Homepage: https://mongodb.com/docs/ruby-driver/
- Documentation: http://www.rubydoc.info/gems/mongo/
- Licenses: Apache-2.0
- Latest release: 2.22.0 (published 15 days ago)
- Last Synced: 2025-12-08T03:33:09.523Z (1 day ago)
- Versions: 202
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 96,091,622 Total
- Docker Downloads: 93,532,152
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.086%
- Downloads: 0.257%
- Maintainers (2)
rubygems.org: mongo
A pure-Ruby driver for connecting to, querying, and manipulating MongoDB databases. Officially developed and supported by MongoDB, with love for the Ruby community.
- Homepage: https://mongodb.com/docs/ruby-driver/
- Documentation: http://www.rubydoc.info/gems/mongo/
- Licenses: Apache-2.0
- Latest release: 2.22.0 (published 15 days ago)
- Last Synced: 2025-12-08T15:02:14.685Z (about 22 hours ago)
- Versions: 202
- Dependent Packages: 498
- Dependent Repositories: 15,704
- Downloads: 96,111,202 Total
- Docker Downloads: 93,532,152
-
Rankings:
- Dependent packages count: 0.092%
- Downloads: 0.272%
- Dependent repos count: 0.282%
- Average: 0.648%
- Docker downloads count: 0.679%
- Forks count: 1.19%
- Stargazers count: 1.373%
- Maintainers (2)
gem.coop: mongo_ext
C extensions to accelerate the MongoDB Ruby driver. For more information about Mongo, see http://www.mongodb.org.
- Homepage: http://www.mongodb.org
- Documentation: http://www.rubydoc.info/gems/mongo_ext/
- Licenses: apache-2.0
- Latest release: 0.19.3 (published over 15 years ago)
- Last Synced: 2025-12-08T16:32:08.092Z (about 21 hours ago)
- Versions: 13
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 309,043 Total
- Docker Downloads: 29,802,571
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Docker downloads count: 0.702%
- Average: 1.519%
- Downloads: 5.372%
- Maintainers (2)
rubygems.org: mongo_ext
C extensions to accelerate the MongoDB Ruby driver. For more information about Mongo, see http://www.mongodb.org.
- Homepage: http://www.mongodb.org
- Documentation: http://www.rubydoc.info/gems/mongo_ext/
- Licenses: apache-2.0
- Latest release: 0.19.3 (published over 15 years ago)
- Last Synced: 2025-12-06T23:02:22.343Z (3 days ago)
- Versions: 13
- Dependent Packages: 31
- Dependent Repositories: 146
- Downloads: 308,904 Total
- Docker Downloads: 29,802,571
-
Rankings:
- Dependent packages count: 0.758%
- Forks count: 1.154%
- Stargazers count: 1.35%
- Docker downloads count: 1.814%
- Average: 2.131%
- Dependent repos count: 2.409%
- Downloads: 5.3%
- Maintainers (2)
proxy.golang.org: github.com/mongodb/mongo-ruby-driver
- Homepage:
- Documentation: https://pkg.go.dev/github.com/mongodb/mongo-ruby-driver#section-documentation
- Licenses: apache-2.0
- Latest release: v2.22.0+incompatible (published 15 days ago)
- Last Synced: 2025-12-06T23:02:23.220Z (3 days ago)
- Versions: 88
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 6.521%
- Average: 6.74%
- Dependent repos count: 6.959%
rubygems.org: mogno
A dummy instance of the Ruby driver for MongoDB, for testing gem deployment
- Homepage: https://mongodb.com/docs/ruby-driver/
- Status: removed
- Documentation: http://www.rubydoc.info/gems/mogno/
- Licenses: Apache-2.0
- Latest release:
- Last Synced: 2025-12-06T23:02:21.479Z (3 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 1 Total
-
Rankings:
- Dependent packages count: 14.758%
- Dependent repos count: 45.206%
- Average: 50.912%
- Downloads: 92.772%
- Maintainers (1)
Dependencies
- bson >= 4.13.0, < 6.0.0
- bson >= 4.14.1, < 5.0.0
- actions/checkout v2 composite
- mongodb-labs/drivers-evergreen-tools master composite
- ruby/setup-ruby v1 composite
- ubuntu bionic build
- debian 10 build
- actions/checkout v3 composite
- ruby/setup-ruby v1 composite
Score: 32.49575648411725