Fetching JSON data with MongoDB and NodeJS
{
"name": "governmentroles",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.17.3",
"mongodb": "^4.5.0"
}
}
nodemon app
Use postman
by default it will only show 10 data per page, add page=x to search specific page
{
"_id": "625b2b784702f2d652bf3faf",
"ID": 1,
"Name": "Cabinet Secretary for Commonwealth Games, Sport, Equalities and Pensioners' Rights",
"Notes": ""
}
{
"_id": "625b2b784702f2d652bf3fb8",
"ID": 10,
"Name": "Cabinet Secretary for Health, Wellbeing and Cities Strategy",
"Notes": ""
}
{
"acknowledged": true,
"deletedCount": 1
}