Skip to content

Memory-based database API, compatible with the DatabaseStream API

License

Notifications You must be signed in to change notification settings

avinoamr/dbstream-memory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dbstream-memory

Memory-based database API, compatible with the dbstream API

Usage

var db = require("dbstream-memory");
var connection = db.connect();

// write or update
var cursor = new connection.Cursor()
cursor.write({ id: 1, name: "Hello" });
cursor.write({ id: 2, name: "World" });
cursor.on("finish", function() {
  console.log("Saved 2 objects");
});
cursor.end();

// read
new connection.Cursor()
  .find({ id: 2 })
  .limit( 1 )
  .on("data", function (obj) {
    console.log("Loaded", obj);
  });

API

This module implements the dbstream API. For the complete documention see: https://github.com/avinoamr/dbstream

connect( [object] )
  • object a key-value map of existing objects
  • Returns a dbstream Connection object

About

Memory-based database API, compatible with the DatabaseStream API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published