Skip to content

AbdulManan27007/MongoDB_CRUD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MongoDB Practice with Express

Overview

This project demonstrates a basic CRUD application using Node.js, Express, and MongoDB. It allows you to create, read, update, and delete users in a MongoDB database.

Setup

  1. Clone the repository:

    git clone https://github.com/yourusername/mongodbpractice.git
    cd mongodbpractice
  2. Install dependencies:

    npm install
  3. Ensure MongoDB is running locally on port 27017.

Usage

  • Start the server:

    node app.js

    The server will run on http://localhost:3000.

  • Endpoints:

    • Create a user: GET /create
    • Read all users: GET /read
    • Update a user: GET /update
    • Delete a user: GET /delete

Examples

Create a User

Navigate to http://localhost:3000/create to create a user with:

Read Users

Navigate to http://localhost:3000/read to view all users.

Update a User

Navigate to http://localhost:3000/update to update a user with username abdulmanan4066 to name Abdul Manan Ilyas.

Delete a User

Navigate to http://localhost:3000/delete to delete the user with username awais.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published