All Projects → FrontendMasters → Intro Mongo Db

FrontendMasters / Intro Mongo Db

[Course] Introduction to MongoDB code

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Intro Mongo Db

Nest User Auth
A starter build for a back end which implements managing users with MongoDB, Mongoose, NestJS, Passport-JWT, and GraphQL.
Stars: ✭ 145 (+27.19%)
Mutual labels:  mongoose, mongo, mongodb
Mean Stack Angular6 Crud Example
MEAN Stack Angular 6 CRUD Web Application
Stars: ✭ 69 (-39.47%)
Mutual labels:  mongoose, mongo, mongodb
Node Typescript Mongodb
node js typescript mongodb express generator yo
Stars: ✭ 96 (-15.79%)
Mutual labels:  mongoose, mongo, mongodb
Spruce
A social networking platform made using Node.js and MongoDB
Stars: ✭ 399 (+250%)
Mutual labels:  mongoose, mongo, mongodb
Mongoose Fuzzy Searching
Mongoose Fuzzy Searching Plugin
Stars: ✭ 94 (-17.54%)
Mutual labels:  mongoose, mongo, mongodb
Mean Angular4 Chat App
MEAN stack with Angular 4 Chat App
Stars: ✭ 41 (-64.04%)
Mutual labels:  mongoose, mongo, mongodb
Typegoose
Typegoose - Define Mongoose models using TypeScript classes.
Stars: ✭ 1,232 (+980.7%)
Mutual labels:  mongoose, mongodb
Lua Mongo
MongoDB Driver for Lua
Stars: ✭ 81 (-28.95%)
Mutual labels:  mongo, mongodb
Mern Boilerplate
Fullstack boilerplate with React, Redux, Express, Mongoose, Passport Local, JWT, Facebook and Google OAuth out of the box.
Stars: ✭ 112 (-1.75%)
Mutual labels:  mongoose, mongodb
Mean Stack Angular5 Crud
MEAN Stack (Angular 5) CRUD Web Application Example
Stars: ✭ 107 (-6.14%)
Mutual labels:  mongo, mongodb
Mongoose Patch History
Mongoose plugin that saves a history of JSON patch operations for all documents belonging to a schema in an associated 'patches' collection
Stars: ✭ 82 (-28.07%)
Mutual labels:  mongoose, mongodb
Boilerplate Vue Apollo Graphql Mongodb
Start your magical stack journey!
Stars: ✭ 85 (-25.44%)
Mutual labels:  mongoose, mongodb
Cheatsheets
JavaScript and Node.js cheatsheets
Stars: ✭ 1,191 (+944.74%)
Mutual labels:  mongoose, mongodb
Typegoose
Typegoose - Define Mongoose models using TypeScript classes.
Stars: ✭ 1,189 (+942.98%)
Mutual labels:  mongoose, mongodb
Fullstack Shopping Cart
MERN stack shopping cart, written in TypeScript
Stars: ✭ 82 (-28.07%)
Mutual labels:  mongoose, mongodb
Avocado
Strongly-typed MongoDB driver for Rust
Stars: ✭ 70 (-38.6%)
Mutual labels:  mongo, mongodb
Angular Full Stack
Angular Full Stack project built using Angular, Express, Mongoose and Node. Whole stack in TypeScript.
Stars: ✭ 1,261 (+1006.14%)
Mutual labels:  mongoose, mongodb
Appy Backend
A user system to bootstrap your app.
Stars: ✭ 96 (-15.79%)
Mutual labels:  mongoose, mongodb
Mongodb Memory Server
Spinning up mongod in memory for fast tests. If you run tests in parallel this lib helps to spin up dedicated mongodb servers for every test file in MacOS, *nix, Windows or CI environments (in most cases with zero-config).
Stars: ✭ 1,376 (+1107.02%)
Mutual labels:  mongoose, mongodb
Rest Hapi
🚀 A RESTful API generator for Node.js
Stars: ✭ 1,102 (+866.67%)
Mutual labels:  mongoose, mongodb

Intro to MongoDB

Scott Moss & Frontend Masters

Resources

Course

Thanks for taking the Introduction to MongoDB course, created by Scott Moss & Frontend Masters. This course aims to cover a wide intro into using MongoDb with Nodejs. Topics refrain from going deep, but instead, focus on a wide view.

Exercises

Installing MongoDB

There are many ways to install MongoDB. The offical website has you covered either way. After installation, you might have to add a dbPath, a location where mongodb saves your data. You can do so like this.

mkdir -p /data/db

Note: If you have an error like "data directory not found" or "permission denied" while installing MongoDB:

sudo mkdir -p /data/db
sudo chown -R $USER /data/db

Models

  • location - exercises/models
  • commands
    • test - yarn test exercises/models/__test__/ or npm test exercises/models/__test__/

This exercise will have you create connection logic and mongoose schemas. Using the schema, you must create some CRUD functionality.

  • [ ] check out to the start branch
  • [ ] install node modules with npm or yarn
  • [ ] check the README on how to run test
  • [ ] create connection logic on connect.js
  • [ ] finish the user schema so that the the user model tests pass
  • [ ] complete the crud functions with the user model and get all the crud test to pass

Queries

  • location - exercises/queries
  • commands
    • test - yarn test exercises/queries/__test__/ or npm test exercises/queries/__test__/

This exercise will have you add relationships between models. You'll then use those models to create slightly more advanced queries than the last exercise

  • [ ] check out to the start branch
  • [ ] check the README on how to run your test
  • [ ] the post model should have have a one-to-one author field that points to the author collection
  • [ ] the post model should have a one-to-many similarPost field that points to posts
  • [ ] get all the post model tests to pass
  • [ ] get all the query tests to pass

Hooks

  • location - exercises/hooks
  • commands
    • test - yarn test exercises/hooks/__test__/ or npm test exercises/hooks/__test__/

In this exercise, you'll learn how to use schema middleware and virtuals. Also, you'll dig into indexes in more detail and create compound indexes.

  • [ ] check out to the start branch
  • [ ] check the README on how to run your test
  • [ ] add a compound index to the project schema so that project names are unique per org
  • [ ] add a virtual getter to the project schema called budgetLeft that calculates how much budget is left vs how much is spent so far
  • [ ] add a post remove hook to the org schema that removes all projects associated with the org
  • [ ] add a virtual getter to the org schema called avatar that creates the fill url to the org avatar by concatinating the cdnUrl with the org id
  • [ ] get all org tests to pass
  • [ ] get all project tests to pass

App

  • location - exercises/app
  • commands
    • start the server - node exercises/app/index.js

In this exercise, you'll have to create queries in Expressjs controllers to satisfy the request. You'll learn how to use mongodb in an API environment. You'll also have the couse to use a hosted MongoDB.

  • [ ] check out to the start branch
  • [ ] check the README on how to run your server
  • [ ] create db query for GET /todo/:id
  • [ ] create db query for GET /todo
  • [ ] create db mutation for POST /todo/
  • [ ] optional create a mLab sandbox and use your hosted DB

Debugging

Note: To handle the error MongoError: E11000 duplicate key error collection drop the database.

mongo
use dbName;
db.dropDatabase();
exit

(dbName is the name of the database)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].