Getting Started with MongoDB and Ruby

Install MongoDB
brew update
brew install mongodb
port install mongodb
mongod is the primary daemon process for the MongoDB system. It handles data requests, manages data format, and performs background management operations. [] Install the gems:
gem update --system
gem install mongo
gem install bson
gem install bson_ext
source: Ruby:
require 'rubygems'  # not necessary for Ruby 1.9
require 'mongo'

include Mongo # Include Mongo so that the Mongo classes are available without having to specify the Mongo namespace.

mongo_client ="localhost", 27017) # A MongoClient instance represents a connection to MongoDB

Leave a Reply

Your email address will not be published. Required fields are marked *