Professional Documents
Culture Documents
Mongo DB
Mongo DB
Mongo DB
use testDB
coll = db.getCollection("newCollection")
coll.find()
coll.find({speed:"120mph"})
Understanding Mongoose
Mongoose is an Object Document Model (ODM) library that wraps around the
MongoDB Node.js driver. The main purpose is to provide a schema-based
solution to model data stored in the MongoDB database.
You are required to provide a schema, which isn’t always the best option
when MongoDB doesn’t require it.
It doesn’t perform certain operations, such as storing data, as well as the
native driver does.
Implementing Express in Node.js
Express is a lightweight module that wraps the functionality of the
Node.js http module in a simple to use interface. Express also extends the
functionality of the http module to make it easy for you to handle server routes,
responses, cookies, and statuses of HTTP requests. This chapter gets you
started implementing Express as the webserver for your Node.js applications.
You learn how to configure the Express server, design routes, and use
the Request and Response objects to send and receive HTTP requests. You also
get a look at how to implement template engines in Express.