splash

A JSON data scheme with search, map/reduce, and transactions.

npm install splash
4 downloads in the last month

splash

The goal of splash is to faciliate JSON data storage with a small feature set.

It's currently experimental.

Document Types

With splash there is a concept of a document type. You can think of it like storing a collection of something. Some examples could be products, articles, users, roles, journal entries, or contacts. Whatever you decide to call your document type splash will create a directory for it so it must be valid input for a directory on your operating system. Every method in the API requires the doc type be passed to it.

Property

dataPath tells the splash instance where to find the data.

Methods

Every method takes doctype as the first argument and cb, a callback function, as the last and may have others in between. The callback always returns err and docs or doc.

Splash.all - Get all documents of a certain doctype Accepts:

  • doctype
  • cb

Splash.one - Only get one document

  • doctype
  • id - The id is really just it's file name
  • cb

Splash.save - Save an existing document

  • doctype
  • id
  • obj
  • cb

Splash.create - Create a new document

  • doctype
  • obj
  • cb

Splash.search

  • doctype
  • query - A case in-sensitive string
  • cb

Splash.match

  • doctype
  • query - An object to compare with the documents
  • cb
npm loves you