Skip to content

willyprayogo26/mongodb-crud

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mongo DB

List of basic routes:

Route HTTP Header(s) Body Description
/books GET none none Get all Books
success:
(200), example: [{"_id: String", "isbn": String, "title": String, "author": String, "category": String, "stock": Number}, {"id: String", "isbn": String, "title": String, "author": String, "category": String, "stock": Number}, etc]
errors:
(500), error
/books/:id GET none none Get book by id
success:
(200), example: {"_id: String", "isbn": String, "title": String, "author": String, "category": String, "stock": Number}
errors:
(404), example: {"message": "Book not found"}
(500), error
/books POST none isbn:String,
title:String,
author:String,
category:String,
stock:Number
Add a book
success:
(200), example: {"_id: String", "isbn": String, "title": String, "author": String, "category": String, "stock": Number}
errors:
(500), error
/books/:id PUT none none Update a book with new values
success:
(200), example: {"n": 1, "ok": 1}
errors:
(404), example: {"message": "Book not found"}
(500), error
/books/:id DELETE none none Delete a book
success:
(200), example: {"n": 1, "ok": 1}
errors:
(404), example: {"message": "Book not found"}
(500), error

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%