The second chapter of our book will focus on schema design for schema-less databases such as MongoDB. This may sound counterintuitive; in fact there are considerations that we should take into account when developing for MongoDB.
The main points of this chapter are:
- Schema considerations for NoSQL
- Data types supported by MongoDB
- Comparison between different data types
- How to model our data for atomic operations
- Modeling relationships between collections:
- One to one
- One to many
- Many to many
- How to prepare data for text searches in MongoDB
- Ruby:
- How to connect using the Ruby mongo driver
- How to connect using Ruby's most widely used ODM, Mongoid
- Mongoid model inheritance management
- Python:
- How to connect using the Python mongo driver
- How to connect using Python's ODM, PyMODM
- PyMODM model inheritance management
- PHP:
- Sample code...