Show:

Base class of any store.

Constructor

Anystore
(
  • opt
)

Defined in lib/anystore.js:15

Parameters:

  • [opt] Object optional

    Anystore options

Methods

getSchemaRelations () Object

Defined in lib/anystore.js:209

Get schema relations.

Returns:

Object:

Schema relation

init
(
  • opt
)
Boolean

Defined in lib/anystore.js:28

Optionnal initialization. Use it to pass optional options to the store implementation, like host, port, ... for example.

Parameters:

  • [opt] Object optional

    Store implementation options

Returns:

Boolean:

true on success

start
(
  • opt
  • cb
)
Promise
async

Defined in lib/anystore.js:44

Start the store.

Parameters:

  • [opt] Object optional

    Store implementation options

  • [cb] Function optional

    Callback function

Returns:

Promise:

true on success

stop
(
  • cb
)
Promise
async

Defined in lib/anystore.js:85

Stop the store.

Parameters:

  • [cb] Function optional

    Callback function

Returns:

Promise:

true on success

validate
(
  • type
  • data
  • mode=create
  • cb
)
Promise
async

Defined in lib/anystore.js:219

Validate entity data.

Parameters:

  • type String

    Entity type reference

  • data Object

    Store implementation options

  • [mode=create] String optional

    Specify operation to use in schema

  • [cb] Function optional

    Callback function

Returns:

Promise:

fails on validation error