Mongoid or MongoMapper? [closed] Mongoid or MongoMapper? [closed] mongodb mongodb

Mongoid or MongoMapper? [closed]


I have used MongoMapper for awhile but decided to migrate to MongoId. The reason is hidden issues plus arrogance towards users. I had to jump through hoops to make MongoMapper work with Cucumber (succeeded in the end) and to put a couple of patches even the project was simple, but it's not the point. When I tried to submit a bug fix (due to incompatibility with ActiveRecord), they seemingly got pissed off that I found a problem and I was pushed around. While I was testing, I also encountered a major bug with their query implementation, while their testing was tuned in a way that the tests pass. After my previous experience, didn't dare to submit it.

They have a significantly lower number of pull requests and bug/feature submissions than MongoId, i.e. community participation is much lower. Same experience as mine?

I don't know which one has more features right now, but I don't see much future in MongoMapper. I don't mind fixing issues and adding functionality myself, but I do mind situations when they wouldn't fix bugs.


i've been using both for the past couple weeks. Mongomapper has better support for relational associations (non-embedded) and has greater third-party support. Mongoid has better query support, much better documentation (MM has close to none, though a website is supposedly in the works), Rail 3 support (and thus Devise support) and a slightly more active community on Google Groups.

I ended up going with Mongoid.


Differences

MongoMapper

  • Claimed to have better support for relational associations.
  • Claimed to be more extensible because of it's plugin architecture.
  • Uses a DSL for querying.
  • Many-to-many associations are updated only one-sided in MongoMapper.
  • Less robust support for embedded documents. Updates the entire model even if only a few attributes are modified.

Mongoid

  • Suggested to be faster than MongoMapper by anecdotal evidence.
  • More robust support for embedded documents, using MongoDB atomic operations ($set, $push, $pull, etc.) to update nested documents in-place.
  • Supports bidirectional many-to-many associations.
  • Uses a chainable ARel-like syntax for querying.

Similarities

  • Both MongoMapper and Mongoid have websites with good documentation. MongoMapper was long claimed to have bad documentation, but their new website seems to close the gap.
  • Both can be configured through a YAML file, and both have a rails generator for that file.
  • Both are fully Rails 3 compatible.

Configuration

MongoMapper

defaults: &defaults  host: 127.0.0.1  port: 27017development:  database: database_name

Mongoid

development:  sessions:    default:      database: database_name      hosts:        - 127.0.0.1:27017

3rd Party Libraries

Both sides have claimed to have better 3rd party support. Github reveals the following:

  • Searching for "Mongoid" yields 12671 results.
  • Searching for "MongoMapper" yields 4708 results.

Notably, Devise does not support MongoMapper.

Commit Activity

Over the last year, it looks like Mongoid has been more regularly maintained and updated than MongoMapper.

MongoMapper

MongoMapper

Mongoid

Mongoid