|
This is an overview of the available tools and suggested practices for using Ruby with MongoDB. Those wishing to skip to more detailed discussion should check out the Ruby Driver Tutorial, Rails - Getting Started, and MongoDB Data Modeling and Rails. There are also a number of good external resources worth checking out. Ruby Driver
The MongoDB Ruby driver is the 10gen-supported driver for MongoDB. It's written in pure Ruby, with a recommended C extension for speed. The driver is optimized for simplicity. It can be used on its own, but it also serves as the basis for various object-mapping libraries. Installing / UpgradingThe ruby driver uses Gemcutter for gem hosting. Before installing the driver, make sure you've installed Gemcutter: $ gem install gemcutter $ gem tumble Once you've added the Gemcutter repository, you can install or upgrade like so: $ gem install mongo To stay on the bleeding edge, check out the latest source from github: $ git clone git://github.com/mongodb/mongo-ruby-driver.git
$ cd mongo-ruby-driver/
Then, install the driver from there: $ rake gem:install C ExtensionThere's a separate gem containing optional, but recommended, C extensions that significantly increase driver performance. To use the extensions just install the mongo_ext gem: $ gem install mongo_ext Or, to install from source: $ rake gem:install_extensions As long it's in Ruby's load path, mongo_ext will be loaded automatically when you require mongo. To learn more about the Ruby driver, see the Ruby Tutorial . Object MappersIf you need validations, associations, and other high-level data modeling functions, consider using one of the available object mappers. Many of these exist in the Ruby ecosystem; here we host a list of the most popular ones. Notable ProjectsTools for working with MongoDB in Ruby are being developed daily. A partial list can eb found in the Projects and Libraries section of our external resources page. If you're working on a project that you'd like to have included, let us know. |

Comments (1)
IF YOU HAVE A QUESTION, POST IT TO THE USER GROUP.
These pages are fine for comments, but for questions, your best bet will always be the MongoDB User Group.Feb 01
Anonymous says:
The Ruby Reflector - MongoDB - News about Ruby and MondoDB.The Ruby Reflector - MongoDB - News about Ruby and MondoDB.
Add Comment