Skip to content

Latest commit

 

History

History
38 lines (33 loc) · 2.28 KB

README.md

File metadata and controls

38 lines (33 loc) · 2.28 KB

MongoDB_Mocha_Mongoose

Example of MongoDB, Mocha and Mongoose in Node.

Steps:

  1. Install MongoDB
  2. Add bin in path : C:\Program Files\MongoDB\Server\4.0\bin
  3. run command : mongo
  4. use command to add mocha , mongoose and nodemon in package,json file: npm install mocha mongoose nodemon
  5. run test cases using command: npm run test

Reference Links:

MongoDB is a general purpose, document-based, distributed database built for modern application developers and for the cloud era.

Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple and fun. Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases.

Mongoose is an Object Data Modeling (ODM) library for MongoDB and Node.js. It manages relationships between data, provides schema validation, and is used to translate between objects in code and the representation of those objects in MongoDB.

Robo 3T (formerly Robomongo) is the free lightweight GUI for MongoDB enthusiasts.
GUI for MongoDB with embedded shell

Nodemon is a utility that will monitor for any changes in your source and automatically restart your server. Perfect for development. Install it using npm.

Just use nodemon instead of node to run your code, and now your process will automatically restart when your code changes. To install, get node.js, then from your terminal run:

npm install -g nodemon

Features

Automatic restarting of application.
Detects default file extension to monitor.
Default support for node & coffeescript, but easy to run any executable (such as python, make, etc).
Ignoring specific files or directories.
Watch specific directories.
Works with server applications or one time run utilities and REPLs.
Requirable in node apps.
Open source and available on github.