A CRUD operation with MongoDB, Node, Express without mongoose
you need to edit .env file with your DB URL, replace YOUR_CONNECTION_URL with proper url once done, simple run
npm install
npm run server
-
Request: Add Task
-
Headers Content-Type: application/json
-
Body { "title": "Task Title", "description": "Task Description", "startDate": "23/09/2022", "dueDate": "23/09/2022", "status": "pending", "priority": "high" }
-
-
Response: 201 Created
-
Request: Get all tasks
-
Response: 200 OK
- Body [ { "title": "Task Title", "description": "Task Description", "startDate": "23/09/2022", "dueDate": "23/09/2022", "status": "pending", "priority": "high" } ]
-
Request: Get a task
-
Response: 200 OK
- Body { "title": "Task Title", "description": "Task Description", "startDate": "23/09/2022", "dueDate": "23/09/2022", "status": "pending", "priority": "high" }
-
Request: Update a task
-
Headers Content-Type: application/json
-
Body { "title": "Task Title", "description": "Task Description", "startDate": "23/09/2022", "dueDate": "23/09/2022", "status": "pending", "priority": "high" }
-
-
Response: 200 OK
-
Request: Delete a task
-
Response: 200 OK
-
Request: Mark task as done date
-
Headers Content-Type: application/json
-
Body { "doneDate": "23/09/2022" }
-
-
Response: 200 OK
-
Request: Change task Status
-
Headers Content-Type: application/json
-
Body { "status": "pending" }
-
-
Response: 200 OK
-
Request: Filter Task by status
-
Response: 200 OK
- Body [ { "title": "Task Title", "description": "Task Description", "startDate": "23/09/2022", "dueDate": "23/09/2022", "status": "pending", "priority": "high" } ]
-
Request: Search Task by title
-
Response: 200 OK
- Body [ { "title": "Task Title", "description": "Task Description", "startDate": "23/09/2022", "dueDate": "23/09/2022", "status": "pending", "priority": "high" } ]
-
Request: Sort tasks by start date, due date, done date
-
Headers Content-Type: application/json
-
Body { "dateType": "startDate", }
-
-
Response: 200 OK
-
Request: Add Project
-
Headers Content-Type: application/json
-
Body { "title": "Project Title", "description": "Project Description", "startDate": "23/09/2022", "dueDate": "23/09/2022" }
-
-
Response: 201 Created
-
Request: Get all projects
-
Response: 200 OK
- Body [ { "title": "Project Title", "description": "Project Description", "startDate": "23/09/2022", "dueDate": "23/09/2022" } ]
-
Request: Get a project
-
Response: 200 OK
- Body { "title": "Project Title", "description": "Project Description", "startDate": "23/09/2022", "dueDate": "23/09/2022" }
-
Request: Update a project
-
Headers Content-Type: application/json
-
Body { "title": "Project Title", "description": "Project Description", "startDate": "23/09/2022", "dueDate": "23/09/2022" }
-
-
Response: 200 OK
-
Request: Delete a project
-
Response: 200 OK
-
Request: Get all tasks of a project
-
Response: 200 OK
- Body [ { "title": "Task Title", "description": "Task Description", "startDate": "23/09/2022", "dueDate": "23/09/2022", "status": "pending", "priority": "high", projectId: "5OM3R4ND0M1D" } ]
-
Request: Assign Task to a Project
-
Headers Content-Type: application/json
-
Body { taskId: "5OM3R4ND0M1D" }
-
-
Response: 200 OK
-
Request: Remove Task from a Project
-
Response: 200 OK
-
Request: Filter Task by Project Name
-
Response: 200 OK
- Body [ { "title": "Task Title", "description": "Task Description", "startDate": "23/09/2022", "dueDate": "23/09/2022", "status": "pending", "priority": "high", projectId: "5OM3R4ND0M1D" } ]
-
Request: Sort Project by start date, due date
-
Headers Content-Type: application/json
-
Body { "dateType": "startDate", }
-
-
Response: 200 OK
- Body [ { "title": "Project Title", "description": "Project Description", "startDate": "23/09/2022", "dueDate": "23/09/2022" } ]
-
Request: Get task by due date
-
Headers Content-Type: application/json
-
Body { "dueDate": "23/09/2022" }
-
-
Response: 200 OK
- Body [ { "title": "Task Title", "description": "Task Description", "startDate": "23/09/2022", "dueDate": "23/09/2022", "status": "pending", "priority": "high", projectId: "5OM3R4ND0M1D" } ]
-
Request: Get project by due date
-
Headers Content-Type: application/json
-
Body { "dueDate": "23/09/2022" }
-
-
Response: 200 OK
- Body [ { "title": "Project Title", "description": "Project Description", "startDate": "23/09/2022", "dueDate": "23/09/2022" } ]