Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Latest commit

 

History

History
61 lines (38 loc) · 3.82 KB

MILESTONE_4.md

File metadata and controls

61 lines (38 loc) · 3.82 KB

Milestone 4

Introduction

So far we have been storing the data in memory, but Emvents Inc. wants to store the data in a persistent way. We will do that using a MongoDB database and the Mongoose ODM (Object Data Modeling).

Get ready

Requirements

  1. Create a variable that references a MongoDB collection that will be used to store “events”

  2. Calling POST /event should save the new event document to the MongoDB collection

  3. Refactor the GET /events endpoint so it gets the events from the MongoDB collection

  4. Refactor the GET /events/{id} endpoint so it gets the event from the MongoDB collection

  5. Updating an existing event (i.e. POST /events/{id}) should save the changes to the MongoDB database.

  6. Deleting an event should delete the event from the database.

  7. Refactor your code using Mongoose

  8. Create a dedicated folder and files to organize your routes.

  9. Create a dedicated folder and files to organize your models.

  10. Make sure all your tests still pass.

  11. Add a new search endpoint (and a test) to allow the user to search events.

  • It should accept a query parameter called “title”
  • It should search events by title
  • It should use the following path: /events/search?title={text_to_search}
  1. Requirement: Create an index in the database to improve the performance of this last query.

NOTE: Do you want to become a remote software developer? Join our online training program where students from all around the world learn together doing remote pair programming, all while working on open source and freelance projects.