Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MongoDB API Emelie Nyberg #506

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
# Project Mongo API

Replace this readme with your own information about your project.

Start by briefly describing the assignment in a sentence or two. Keep it short and to the point.
This is a RESTful API built using Express and Mongoose to provide access to a dataset of Nintendo Switch games. The dataset includes game details like id, name, category, release_year, and rating. The project demonstrates how to model data with Mongoose, seed a MongoDB database, and build endpoints to query and retrieve data.

## The problem

Describe how you approached to problem, and what tools and techniques you used to solve it. How did you plan? What technologies did you use? If you had more time, what would be next?
The task was to create an API that fetches data from a MongoDB database using Mongoose. Key challenges included:

1. Modeling the dataset with Mongoose to ensure the data was stored consistently.
2. Seeding the database with a JSON file containing the dataset.
3. Creating RESTful endpoints for filtering and retrieving data based on parameters like category, release_year, and rating.
4. Writing clean and reusable code while adhering to RESTful principles.

To solve these challenges, I:

- Used mongoose to define models and interact with the database.
- Wrote a seeding function to populate the database.
- Used query parameters to add filtering and sorting functionality to the API endpoints.
- Tested the API with tools like Postman and debugged using console logs.

If I had more time, I would:

- Implement pagination using .skip() and .limit().
- Add more advanced querying using MongoDB's aggregate pipeline.
- Enhance error handling and validation of query parameters.

## View it live

Every project should be deployed somewhere. Be sure to include the link to the deployed project so that the viewer can click around and see what it's all about.
https://project-mongo-api-ek.onrender.com
Loading