This repository demonstrates basic MongoDB operations using a database named "graduates" and a collection named "users."
-
Insert Data:
- The
insertData.js
script populates the "users" collection with sample data.
- The
-
Show Male Users who are Single:
- The
/singleMaleUser
route inuserRoutes.js
fetches and displays data of "Male" users who are "Single."
- The
-
Show Female Users with Scores > 80%:
- The
/femaleScoreMoreThan80
route inuserRoutes.js
retrieves and presents data of "Female" users who scored more than 80%.
- The
-
Show Users with Scores >= 50%:
- The
/allUserMoreThanOrEqual50
route inuserRoutes.js
fetches and showcases data of all users with scores equal to or greater than 50%.
- The
-
Update Female Users with Scholarship:
- The
/updateFemaleScholarship
route inuserRoutes.js
updates all "Female" users, adding a new field "scholarship" set totrue
.
- The
-
Delete Users with Scores < 40%:
- The
/deleteUserLessThan40
route inuserRoutes.js
deletes all users with scores less than 40%.
- The
-
Clone the repository:
git clone https://github.com/yourusername/graduates-database.git
-
Install dependencies:
npm install
-
Run the application:
node index.js
Visit the respective routes in your browser or API client to see the results.