crudlet-memory

1.0.2 • Public • Published

Build Status Coverage Status Dependency Status

in-memory adapter for crudlet - a library that makes it easy to persist data through multiple transports.

installation

npm install crudlet-memory
var crudlet = require("crudlet");
var memorydb = require("crudlet-memory");
 
var db = memorydb();
db(crudlet.operation("insert", { data: { name: "blarg"}})).on("data", function() {
 
});
 
// streaming operations
crudlet.
open(db).
write(crudlet.operation("insert", { data: { name: "abba"}})).
end(crudlet.operation("remove", { query: { name: "abba"}}));

db memorydb(options)

creates a local crudelt database

  • options - options for the local db
    • name - name of db (optional)
    • store - store to use

runs an operation

  • operation - operation to run can be: insert, remove, update, or load
  • options - operation specific options

insert options:

  • data - data to insert. Can be an object, or an array to insert multiple

remove options:

  • query - mongodb search query
  • multi - TRUE if you want to remove multiple items (false by default)

update options:

  • query - mongodb search query
  • multi - TRUE if you want to update multiple items (false by default)
  • data - data to set - this is merged with existing data

load options:

  • query - mongodb search query
  • multi - TRUE if you want to load multiple items (one by default)

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.20latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.20
1.0.10
1.0.00
0.0.130
0.0.120
0.0.110
0.0.100
0.0.90
0.0.81
0.0.70
0.0.60
0.0.40
0.0.30
0.0.20

Package Sidebar

Install

npm i crudlet-memory

Weekly Downloads

1

Version

1.0.2

License

ISC

Last publish

Collaborators

  • architectd
  • crcn