In Ruby, there are currently 3 ODM (object data mappers) maintained:
Which is your preferred and why?
In Ruby, there are currently 3 ODM (object data mappers) maintained:
Which is your preferred and why?
I just chose Mongoid for a new Rails 3 project based on the argument that it has the best documentation.
Since I am new to MongoDB (with many years of MySQL and a little bit of CouchDB experience), I needed good guides that take me by the hand and help me deliver something working within a reasonable span of time.
AFAIK Mongoid has just that: a nice looking site, with well documented guides for newbies like me.
Code Stats for Mongoid and MongoMapper
It looks like MongoMapper has much better code quality (if it does the same with less).
Here s the analyzer CodeStats https://github.com/alexeypetrushin/code_stats
In my opinion it s hard to say which is better, if you have DataMapper experience you ll like MongoMapper, but if you used ActiveRecord, Mongoid it s your preferred choice. I believe all of them worths a try concerning the context where you want to use them.
I am using MongoMapper. It good except it is little slow with Time conversions.
And it loads all data as Array. MyCollection.all
for example gives you huge array, not cursor.
while Mongoid says: - Optimized for use with extremely large datasets.
So I guess you could try MongoID if you need speed and have big recordsets.
I was trying MongoMapper, but I think I ll go with Mongoid, because after quick reading docs it seems to me somewhat easier. Plus, it s developed by guys from Hashrocket, so that s a good reason itself.
While not a direct answer to your question, I would also consider using the basic ruby driver directly. Unlike the various SQL adapters out there Mongo s ruby class is easy to use and powerful. Because queries are hashes, composing queries is generally easy. The real advantage is access to the Atomic Modifiers. If you benefit from a Document database, these modifiers should be in your toolbox.
Having said this, I will go ahead and recommend MongoMapper because it has cleaner integration with the non-CRUD parts of MongoDB. Both projects are making gains in this area, and the situation may have changes since I did my research in December 2010.
I can recommend MongoMapper, since it also works with rails3 (beta and master). I personally didn t try the other 2 mappers you mentioned, since MM works great in my workflow and the mailinglist is very active. Furthermore the codebase is really stable and the only issue is with rails3 master, so you should use fredwu s branch, which already includes fixes for the current rails3 master changes on form_for: http://github.com/fredwu/mongomapper.git
There s also MongodbModel http://alexeypetrushin.github.com/mongodb_model
The project I m doing is written in Java and parsers source code files. (Java src up to now). Now I d like to enable parsing Ruby code as well. Therefore I am looking for a parser in Java that parses ...
collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...
All of the following API do the same thing: open a file and call a block for each line. Is there any preference we should use one than another? File.open("file").each_line {|line| puts line} open("...
I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?
Here s the string: 04046955104021109 I need it to be formatted like so: 040469551-0402-1109 What s the shortest/most efficient way to do that with ruby?
I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml
Can sources for discrete ruby extension modules live in the same directory, controlled by the same extconf.rb script? Background: I ve a project with two extension modules, foo.so and bar.so which ...
guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...