Mongo Mapper

A Mongo ORM for Ruby

Built from the ground up to be simple and extendable, MongoMapper is a lovely way to model your applications and persist your data in MongoDB. It has all the bells and whistles you need to get the job done and have fun along the way.

Getting Started

Install the MongoMapper gem:

$ gem install mongo_mapper

Define your models:

class User
  include MongoMapper::Document

  key :name, String
  key :age,  Integer

  many :hobbies
end


class Hobby
  include MongoMapper::EmbeddedDocument

  key :name,    String
  key :started, Time
end

Use your models to create and find documents:

user = User.new(:name => 'Brandon')
user.hobbies.build(:name => 'Programming',
  :started => 10.years.ago)

user.save!

User.where(:name => 'Brandon').first

Check out the Documentation

Who’s Using MongoMapper?

Fork me on GitHub