O'Reilly logo

Learning Mongoid by Gautam Rege

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. Mongoid Document Model

This is where we prepare to take the deep dive. In this chapter we shall see what we mean by documents and look into some of the internal access and storage. We shall learn about the various data types including some new ones that were added to Mongoid 3.

The Mongoid document

MongoDB stores documents that have fields and maybe other documents embedded in it. The documents are stored in collections. This is analogous to records stored in tables. The difference is that documents, unlike records in a SQL database, need not have the same structure or fields. In fact, as we have already seen in the previous chapter, there is no standard structure for storing documents in MongoDB.

So, do we define a default structure when ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required