SDB is a NodeJS module that offers a direct memory database with a syntax similar to MongoDB.
var sdb = require('./sdb.js'); // new database, read existing data from file var mydb = new sdb('./my.db'); // insert mydb.insert({a_simple_field: 'a_simple_value'}); mydb.insert({second_simple_field: 'second_simple_value'}); // update with $set and $add as upsert mydb.update({second_simple_field: '2nd second_simple_value'}, {$set: {second_simple_field: '2nd second_simple_value'}, $add: {counter: 2}}, {upsert: true}); // find all mydb.find({}); // index mydb.index('a_simple_field', true, false); // remove mydb.remove({_id: doc[0]._id}); // $fulltext find var data = mydb.find({title: {$fulltext: 'test is a'}}); // save to disk mydb.save('./my.db');
It is also capable of sort, limit and skip.