July 2012
Beginner to intermediate
342 pages
7h 27m
English
Mongoskin is a convenience library providing a high-level interface for mongodb without blocking access to the existing mongodb methods.
For this recipe, we'll re-implement the quotes database in MongoDB using Mongoskin.
We'll need the mongoskin module.
npm install mongoskin
We can also create a new folder, with a new quotes.js file.
We'll require mongoskin and use it to make a client and a collection instance. We don't need to create a server instance, nor manually open the client as in the former recipe, mongoskin takes care of that.
var mongo = require('mongoskin'); var client = mongo.db('localhost:27017/quotes'); var collection = client.collection('quotes'); var params = {author: ...Read now
Unlock full access