Grokking Node.js
Vote

0% completed

​

Performing CRUD Operations in MongoDB

Every application that stores data does four things with it: it creates records, reads them, updates them, and deletes them. Together these four operations are called CRUD, from the first letter of each. This lesson performs all four on a users collection with Mongoose, the library introduced in the previous lesson, and shows the real result of each call.

The Script

All the code in this lesson runs inside one script. It uses the same User model as before, with one new rule: min: 0 on age, which forbids negative ages.

const mongoose = require('mongoose');

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content