更新时间:2021-07-21 18:03:36
coverpage
Learning Mongoid
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files eBooks discount offers and more
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Chapter 1. What's so Awesome about Mongoid?
A practical approach using the Sodibee library system
Notice about Mongoid 2.x
Mongoid and MongoMapper
Summary
Chapter 2. Mongoid Document Model
The Mongoid document
Embedded documents
Localization
Mass assignment and security
Chapter 3. Persisting Documents
MongoDB persistence strategy
Validations
Callbacks
Chapter 4. Mongoid Relations
Configuring relationships
has_one – the one-to-one relation
has_many – the many-to-one relation
The belongs_to relation
has_and_belongs_to_many – the many-to-many relation
Polymorphic relations
embeds_many – embedding many documents
embeds_one – embed one document
embedded_in – resolving children
Embedded polymorphic relations
Chapter 5. Mongoid Queries
Origins of Origin
Query selectors
Mongoid criteria
Queries on arrays and hashes
Atomic modifiers
Querying with indexed fields
The aggregation framework
Geolocation queries
Chapter 6. Performance Tuning
MongoDB environment
Indexes
IdentityMap
MapReduce and the aggregation framework
Monitoring query performance
Good practices and recommendations
Chapter 7. Mongoid Modules
Timestamping
Versioning
Paranoia
Acts as state machine (aasm)
Index