日期:2014-05-16  浏览次数:20413 次

Node.js知识学习之——Node.js and MongoDB – Getting started with MongoJS

Node.js and MongoDB – Getting started with MongoJS

关注Node.js微信,每天推送新知识


It won’t be an exaggeration if one claims that in the past few months Node.js and MongoDB have literally taken the software and web industries by storm.

Not just bleeding-edge startups but even medium and large enterprises are leveraging these two technologies to deliver a better experience to their users by build more capable, performant and scalable apps.

So what is Node.js?

Node.js is a platform built on Chrome’s JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

..and what is MongoDB?

MongoDB is a scalable, high-performance, open source NoSQL database.

This post will cover the basics and get you started with your Node.js + MongoDB app. Make sure you have Node.js installed and MongoDB setup on your developer machine.

Let’s verify your Node.js installation and start the MongoDB server:

$ node -v
$ mongod

Introducing MongoJS
MongoJS is a brilliant little Node.js package that lets you access MongoDB using an API that is extremely similar to MongoDB’s JavaScript shell.