Skip to main content

Posts

Showing posts with the label find methods

Database Project Study: How To Use Mongoose To Model Your Database?

What is Mongoose? According to Mongoose , Mongoose is an elegant MongoDB object modeling for Node.js. It provides a straight-forward, schema-based solution to model your application data. Basically, Mongoose is a package which helps us interact with Mongo DB. It is a JavaScript layer on top of Mongo DB, and it adds some extra special methods that makes our live easier. How to Install Mongoose? The installation is very simple. We just need to npm install mongoose in our server. Then, we create a JavaScript file, and require the mongoose. Since the Mongoose needs to interact with MongoDB, we need to open another terminal window to call "./mongod"and make sure the MongoDB is running .  Then, we connect Mongoose with MongoDB: mongoose.connect("mongodb://localhost/score_app") . Score Database Project Study In this project, I am going to create a score app which contains student score data. The score data includes three main entries: name...