Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

mesh-loki-ds-bus

2.0.4 • Public • Published

Streamable data store bus for LokiJS, an in-memory JavaScript database. Action docs on this library can be viewed here: https://github.com/crcn/mesh.js/blob/master/docs/adapters/data-stores.md.

Installation: npm install mesh-loki-ds-bus

basic example:

var mesh      = require("mesh");
var LokiDsBus = require('mesh-loki-ds-bus');
var loki      = require('lokijs');
 
// setup the DB
var dsBus = LokiDsBus.create({
  target: new loki(__dirname + "/db.json")
});
 
var cursor = dsBus.execute({
  collection : 'people',
  action     : 'name',
  data       : [
    { name: "Sleipnir"    , legs: 8 },
    { name: "Jormungandr" , legs: 0 },
    { name: "Hel"         , legs: 2 }
  ]
});
 
cursor.readAll().then(function(people) {
 
});

LokiDsBus.create(options)

Creates a new loki data store bus.

  • options
    • target - the target loki instance.

Keywords

none

install

npm i mesh-loki-ds-bus

Downloadsweekly downloads

34

version

2.0.4

license

ISC

last publish

collaborators

  • avatar
  • avatar