Where to Go Next
You have reached the end of the course. You can now find documents with filters, operators, projections and sorting. You can insert, update, upsert and delete them, and read the report each write returns. You have worked with nested documents, arrays and dates, and with documents that have different fields. You can summarize data with aggregation pipelines, join collections with $lookup, and add indexes.
Here are good next topics, starting with the most useful:
- Schema validation lets a collection reject documents that do not have the shape you expect.
- Compound indexes cover more than one field, like
{ director: 1, year: -1 }. Learning to design them, and to readexplain(), is the next step in making queries fast. - Transactions let several writes to different documents succeed or fail together.
- Replication and sharding spread a database over several servers, for safety and for size.
- Change streams let your app react when documents in a collection change.
Finally, a document database is not the right tool for every job. When data has many links between many collections, a table database with SQL is often a better fit. When each record is mostly self-contained and records differ in shape, documents work well.
One last question about this choice, and then you are done. Well done for getting this far.