This repo use [MongoDB Native Driver] (https://mongodb.github.io/node-mongodb-native/contents.html) with singleton pattern and crud base object.
- node and npm
- Clone the repo:
git clone [email protected]:eduardorha/nodejs_singleton_mongodb.g
- Install dependencies:
npm install
- Change config options to connect with you MongoDB database in
adapters/mongo.js
- Start the server:
node app.js
Once everything is set up, we need create a documents on MongoDB test collection.
Send a GET
request to http://localhost:3000/load_data
Send a GET
request to http://localhost:3000/find_all
Send a GET
request to http://localhost:3000/update_one
Send a GET
request to http://localhost:3000/remove_one