mesh-memory-ds-bus
v5.0.1
Published
Creates an in-memory data store bus.
Downloads
2
Readme
Creates an in-memory data store bus.
var target = [];
var bus = MemoryDsBus.create(target);
await bus.execute({ action: "insert", collection: 'people', data: { name: "blarg" } });
console.log(target); // [{ name: blarg }]
var cursor = bus.execute({ action: "find", collection: 'people', query: { name: "blarg" } });
var item = await cursor.read();
console.log(item); // { name: blarg }
await bus.execute({ action: "update", collection: 'people', query: { name: "blarg" }, data: { name: "jeff" }});
console.log(target); // [{ name: "jeff" }]