Description
In this course, you will :
-
Understand how MongoDB stores data
-
Gain mastery of the most popular MongoDB interface, Mongoose JS
-
Write efficient queries for reading data
-
Learn the purpose of each of Mongoose's functions
-
Design effective NoSQL schema with both data nesting and lookups
Syllabus :
1. OSX Setup
- MongoDB Setup on OSX
- More OSX Setup - Robomongo
2. Windows Setup
- Windows Setup
- RoboMongo Setup
3. A Quick ES6 Refresher
- A Refresher on Promises
- Let's Play A Game
- Winning the Game
- Behind the Scenes with Promises
4. Core Fundamentals of MongoDB
- Where Do We Use Mongo?
- Fundamentals of MongoDB
- A Last Touch of Setup
5. A Test Driven Experience
- The Test Helper File
- Mongoose Connection Helper
- Mongoose Models
- More on Models
- The Basics of Mocha
- Running Mocha Tests
- Creating Model Instances
- Saving Users to Mongo
- Dropping Collections
- Mocha's Done Callback
- Mongoose's isNew Property
- Default Promise Implementation
- Test Setup for Finding Users
- Making Mongo Queries
- The ID Property - A Big Gotcha
- Automating Tests with Nodemon
- Finding Particular Records
- The Many Ways to Remove Records
- Class Based Removes
- More Class Based Removals
- The Many Ways to Update Records
- Set and Save for Updating Records
- Model Instance Updates
- Class Based Updates
6. Mongo Operators
- Update Operators
- The Increment Update Operator
- Validation of Records
- Requiring Attributes on a Model
- Validation With a Validator Function
- Handling Failed Inserts
7. Handling Relational Data
- Embedding Resources in Models
- Nesting Posts on Users
- Testing Subdocuments
- Adding Subdocuments to Existing Records
- Removing Subdocuments
- Virtual Types
- Defining a Virtual Type
- ES6 Getters
- Fixing Update Tests
8. Thinking About Schema Design
- Challenges of Nested Resources
- Embedded Documents vs Separate Collections
- BlogPosts vs Posts
- Creating Associations with Refs
- Test Setup for Associations
- Wiring Up Has Many and Has One Relations
- Promise.All for Parallel Operations
- Populating Queries
- Loading Deeply Nested Associations
9. Mongoose Middleware
- Cleaning Up with Middleware
- Dealing with Cyclic Requires
- Pre-Remove Middleware
- Testing Pre-Remove Middleware