Grokking ExpressJS
0% completed
Performing CRUD Operations with MongoDB
Five routes cover what a client does with the bookstore's books: create one, list them, read one, change one, and delete one. Together these four kinds of work are called CRUD, for Create, Read, Update, and Delete. Each route in this lesson calls one Mongoose method on the Book model from the previous lesson, and one error-handling middleware turns database errors into clear HTTP responses.
| Operation | Route | Mongoose method | Success status |
|---|---|---|---|
| Create | POST /books | Book.create() | 201 Created |
| Read many | GET /books | Book.find() | 200 OK |
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%