concept practice in category mongoDB

appears as: practice
MongoDB in Action, Second Edition: Covers MongoDB version 3.0

This is an excerpt from Manning's book MongoDB in Action, Second Edition: Covers MongoDB version 3.0.

You’ve probably noticed that in addition to providing a richness of structure, documents needn’t conform to a prespecified schema. With a relational database, you store rows in a table. Each table has a strictly defined schema specifying which columns and types are permitted. If any row in a table needs an extra field, you have to alter the table explicitly. MongoDB groups documents into collections, containers that don’t impose any sort of schema. In theory, each document in a collection can have a completely different structure; in practice, a collection’s document will be relatively uniform. For instance, every document in the posts collection will have fields for the title, tags, comments, and so forth.

Then it’s on to indexing in practice. We’ll discuss unique, sparse, and multikey indexes, and provide a number of pointers on index administration. Next, we’ll delve into query optimization, describing how to use explain() and work harmoniously with the query optimizer.