Created
September 27, 2016 21:29
-
-
Save dvisockas/2dd475bbfdf26a03ce2c62599eafcbce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var db = require('diskdb'); | |
db.connect('db', ['articles']); | |
var article1 = { | |
title : 'diskDB rocks', | |
published : 'today', | |
rating : '5 stars' | |
} | |
var article2 = { | |
title : 'diskDB rocks', | |
published : 'yesterday', | |
rating : '5 stars' | |
} | |
var article3 = { | |
title : 'diskDB rocks', | |
published : 'today', | |
rating : '4 stars' | |
} | |
db.articles.save([article1, article2, article3]); | |
var foundArticles = db.articles.find({rating : "5 stars", published: "yesterday"}); | |
console.log(foundArticles); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment