MarkMapper is a community-driven Ruby Object Mapper for MarkLogic. It has all the bells and whistles you expect from ActiveRecords (validation, finders, callbacks, etc). MarkMapper helps you set up databases and application servers. Once you define your object model, MarkMapper will serialize to/from JSON for you.

MarkMapper requires MarkLogic 8 or greater. It persists all documents as JSON. Check out the Documentation for more.

Getting Started

Install the MarkMapper gem:

$ gem install mark_mapper

Define your models:

class User
  include MarkMapper::Document

  key :name, String
  key :age,  Integer

  many :hobbies
end


class Hobby
  include MarkMapper::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

Visit the Repository

Learn More

MarkMapper

Find out how to get started with MarkMapper, go through the documentation, visit the FAQ, and find some code to help you use MarkMapper.

MarkMapper Documentation

Go through the documentation that explains how to get started, what MarkMapper’s document types are, the plugins it uses, and how querying works in MarkMapper.

MarkMapper FAQ

Find out what the difference is between a document and an embedded document and when you should embed.

This website uses cookies.

By continuing to use this website you are giving consent to cookies being used in accordance with the MarkLogic Privacy Statement.