What this book covers
Chapter 1, What's so Awesome about Mongoid?, explains why Mongoid is one of the popular choices for Rails applications that use MongoDB. We are also introduced to Origin and Moped, which are integral parts of Mongoid.
Chapter 2, Mongoid Document Model, discusses the various data types that are supported by Mongoid and how they are stored. We learn about arrays, hashes, and embedded documents. We also briefly touch upon localized storage of string.
Chapter 3, Persisting Documents, discusses how documents are saved, format, optimization, and even managing custom data types and their serialization. We will also learn about atomic updates, callbacks, and validations.
Chapter 4, Mongoid Relations, explains the various relations that are supported by Mongoid, including One-to-One, One-to-Many, recursively embedded documents, and even polymorphic relations.
Chapter 5, Querying Attributes, explains everything about searching. We take a deep dive into how Origin works and how Mongoid criteria are managed. We learn about criteria chaining, lazy evaluation, and even eager loading of related documents.
Chapter 6, Performance Tuning, deals with how we can improve performance. We learn about the various indexes and when to use the right index. We see how the identity map can help in eager loading. Finally, we learn about MapReduce and the aggregation framework, which can drastically improve performance.
Chapter 7, Mongoid Modules, introduces various modules and gems available, which can help enhance the features with Mongoid. We learn about paranoid deletes, versioning, cloning, slugs, authentication, authorization using Devise, and even uploading documents using CarrierWave.