I'm Co-Founder & CTO of BlockAvenue. , connect with me, or subscribe.

Getting started with MongoDB and Mongoid on Rails

Having recently delved into the world of MongoDB and Mongoid here’s a few resources (some obvious and some not) I found quite handy.

Start here

Be sure to start with the official MongoDB, Mongoid, and MongoDB Ruby driver documentation. There is a lot of good stuff in there.

SQL to Mongo Mapping Chart

If you prefer to learn by example, the official MongoDB docs have a great table of SQL / MongoDB statement equivalents.

MapReduce and server-side code execution

If you heavily use aggregates in SQL you will quickly miss them in MongoDB. Rick Osborne put together a great infographic on translating SQL to MapReduce (at least in your head). Here’s the PDF version.

Also be sure to check out the reference on server-side code execution.

This gist provides an example (in Java) of executing server-side code when MapReduce is too heavy and in-place updates are not possible.

What are your favorite MongoDB-related resources?