Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ MongoDB Assignment

Welcome to the MongoDB Assignment repository! This project demonstrates basic CRUD operations using Node.js, Express.js, and MongoDB as part of semester coursework.


πŸ“‚ Repository Structure

The repository contains a single server application for managing user data.

mongodbAssignment/
β”œβ”€β”€ server_assign/        # πŸ‘₯ User Management API
β”‚   β”œβ”€β”€ index.js
β”‚   β”œβ”€β”€ package.json
β”‚   └── .gitignore
└── README.md

πŸ“‹ Assignment Overview

# Folder Project Name Description Port Status
1 server_assign πŸ‘₯ User Management API RESTful API to manage user records with MongoDB 3000 βœ… Completed

πŸ› οΈ Assignment Details

1. πŸ‘₯ User Management API (/server_assign)

A RESTful API for managing user data stored in MongoDB.

Tech Stack: Node.js Β· Express.js Β· MongoDB Β· Mongoose

Features:

  • πŸ“‹ List all users
  • πŸ†” Fetch a specific user by ID
  • βž• Add a single user
  • βž•βž• Add multiple users
  • ✏️ Update a user (PATCH)
  • ✏️ Update a user (PUT)
  • πŸ—‘οΈ Delete a user

API Endpoints:

Method Endpoint Description
GET / Basic health check
GET /users Retrieve all users
GET /user/:id Fetch a user by ID
POST /adduser Add a single user
POST /addusers Add multiple users
PATCH /patch-user/:id Update a user partially
PUT /put-user/:id Update a user fully
DELETE /delete-user/:id Delete a user

Sample User Schema:

  • _id: Number
  • name: String
  • city: String
  • membership: String

πŸš€ Getting Started

  1. Navigate to the server_assign folder.
  2. Install dependencies: npm install
  3. Ensure MongoDB is running and update the connection string in index.js if needed.
  4. Start the server: npm start or node index.js

The server will run on port 3000 by default.


πŸ“ License

This project is for educational purposes only.


Developed with ❀️ by Deepak Kumar

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages