1.0.2 • Published 9 years ago

crudlet-memory v1.0.2

Weekly downloads
7
License
ISC
Repository
github
Last release
9 years ago

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)
1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.0.13

9 years ago

0.0.12

9 years ago

0.0.11

9 years ago

0.0.10

9 years ago

0.0.9

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago