The Complete Developers Guide to MongoDB

The Complete Developers Guide to MongoDB

English | MP4 | AVC 1920×1080 | AAC 44KHz 2ch | 130 Lessons (13h 1m) | 6.26 GB

Master MongoDB and Mongoose design with a test-driven approach

MongoDB is the hottest database solution in the tech world right now, able to power anything from your growing personal project to an enterprise infrastructure.

NodeJS focused?  Yep.  Test Driven Exercises?  Absolutely!  Advanced Features of MongooseJS?  You know it.

This course will get you up and running with MongoDB quickly, and teach you the core knowledge you need to deeply understand and build apps centered around Mongo.

We’ll start by mastering the fundamentals of Mongo, including collections, validations, and common record manipulation techniques. Source code is provided for each lecture, so you will always stay up-to-date with the course pacing.  Special attention has been paid to creating reusable code that you’ll be able to make use of on your own fantastic projects.

If you are new to MongoDB, or if you’ve been working to learn it but sometimes feel like you still don’t quite ‘get it’, this is the MongoDB course for you! To learn MongoDB you have to understand it.

  • Learn how to use the popular MongooseJS library to interface with Mongo
  • Write tests around Mongo queries to ensure your code is working. You can reuse these tests on your own personal projects!
  • Master the process of designing NoSQL schema
  • Grasp the differences record associations and resource embedding
  • Use the advanced features of Mongoose to save development time
  • Develop apps that are fast and responsive thanks to Mongo’s speed and flexibility
  • Work on either Windows or OSX
  • Master the integration of Mongo, Node, and Mocha in a modern development environment

I’ve built the course that I would have wanted to take when I was learning MongoDB. A course that explains the concepts and how they’re implemented in the best order for you to learn and deeply understand them.

Who this course is for:

  • This course is for anyone learning MongoDB in the Node JS environment
Table of Contents

Let’s Start
1 Join Our Community!
2 MongoDB Setup on macOS
3 MongoDB Setup on Windows
4 Using MongoDB Compass on macOS
5 Using MongoDB Compass on Windows

A Quick ES6 Refresher
6 A Refresher on Promises
7 Let’s Play A Game
8 Winning the Game
9 Behind the Scenes with Promises

Core Fundamentals of MongoDB
10 Where Do We Use Mongo
11 Fundamentals of MongoDB
12 A Last Touch of Setup

A Test Driven Experience
13 Project Overview
14 The Test Helper File
15 Mongoose Connection Helper
16 Mongoose Models
17 More on Models
18 The Basics of Mocha
19 Running Mocha Tests
20 Creating Model Instances
21 Saving Users to Mongo
22 Dropping Collections
23 Mocha’s Done Callback
24 Mongoose’s isNew Property
25 Default Promise Implementation
26 Test Setup for Finding Users
27 Making Mongo Queries
28 The ID Property – A Big Gotcha
29 Automating Tests with Nodemon
30 Finding Particular Records
31 Many Ways to Remove Records
32 Class Based Removes
33 More Class Based Removals
34 The Many Ways to Update Records
35 Set and Save for Updating Records
36 Model Instance Updates
37 Class Based Updates

Mongo Operators
38 Update Operators
39 The Increment Update Operator
40 Validation of Records
41 Requiring Attributes on a Model
42 Validation With a Validator Function
43 Handling Failed Inserts

Handling Relational Data
44 Embedding Resources in Models
45 Nesting Posts on Users
46 Testing Subdocuments
47 Adding Subdocuments to Existing Records
48 Removing Subdocuments
49 Virtual Types
50 Defining a Virtual Type
51 ES6 Getters
52 Fixing Update Tests

Thinking About Schema Design
53 Challenges of Nested Resources
54 Embedded Documents vs Separate Collections
55 BlogPosts vs Posts
56 Creating Associations with Refs
57 Test Setup for Associations
58 Wiring Up Has Many and Has One Relations
59 Promise.All for Parallel Operations
60 Populating Queries
61 Loading Deeply Nested Associations

Mongoose Middleware
62 Cleaning Up with Middleware
63 Dealing with Cyclic Requires
64 Pre-Remove Middleware
65 Required Pre Remove Hook Updates
66 Testing Pre-Remove Middleware

Handling Big Collections with Pagination
67 Skip and Limit
68 Writing Skip and Limit Queries
69 Sorting Collections

Putting Your Skills to the Test
70 Required Starter Files – DO NOT SKIP
71 Project Overview
72 First Step – Artist and Album Models
73 The Album Schema
74 The Artist Model
75 Finding Particular Records
76 FindOne vs FindById
77 The CreateArtist Operation
78 Solution to Creating Artists
79 Deleting Singular Records
80 Solution to Removing
81 Editing Records
82 How to Edit Single Artists

Hard Mode Engage
83 Minimum and Maximum Values in a Collection
84 Solution to Min and Max Queries
85 Challenge Mode – Search Query
86 Sorting, Limiting, and Skipping Together
87 Danger! Big Challenge Ahead
88 Filtering By Single Properties
89 Filtering with Multiple Props
90 Handling Text Search
91 Indexes and Text Search
92 Batch Updates
93 The Hidden ‘Multi’ Setting
94 Seeding Many Records
95 Counting the Result Set

MongoDB with Node and Express
96 App Overview
97 Designing API Routes
98 Project Setup
99 HTTP Request Methods
100 The Basics of Express
101 Express Boilerplate
102 Handling Requests with Express
103 Testing Express Apps with Mocha
104 Running Mocha
105 Project Structure
106 Refactoring for Controllers and Models
107 The Driver Model
108 The Create Drivers Route
109 The BodyParser Middleware
110 Testing Driver Creation
111 More on Testing Driver Creation
112 Additional Mongoose Setup
113 Driver Implementation
114 Testing Endpoints with Postman
115 Dev vs Test Environments
116 Separate Test Databases
117 Middlewares in Express
118 Handling Editing of Drivers
119 Testing Driver Updates
120 Handling Deletion of Drivers
121 Testing Driver Deletion
122 Geography with MongoDB
123 The GeoJSON Schema
124 GeoNear Queries
125 Major GeoNear Aggregation Update
126 Testing a GeoNear Query
127 One Big Gotcha
128 Another Big Gotcha
129 Testing GeoQueries

Extras
130 Bonus!

Homepage