MongoDB_Mocha_Mongoose

Example of MongoDBm Mocha and Mongoose in Node.

Stars
1
Committers
1

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: https://www.mongodb.com/

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

Documentation: https://docs.mongodb.com/manual/introduction/

Mocha: https://mochajs.org/#installation

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: https://mongoosejs.com/docs/guide.html

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: https://robomongo.org/

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

Nodemon: https://nodemon.io/

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.

Documentation: https://github.com/remy/nodemon#nodemon