Skip to content

Instantly share code, notes, and snippets.

@dvisockas
Created September 27, 2016 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dvisockas/2dd475bbfdf26a03ce2c62599eafcbce to your computer and use it in GitHub Desktop.
Save dvisockas/2dd475bbfdf26a03ce2c62599eafcbce to your computer and use it in GitHub Desktop.
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