API Reference

Schema Class

Defined in lib/schema.js:9

Description

The schema constructor.

Constructor

Schema

([schema])
Defined in lib/schema.js:9

The schema constructor.

Parameters

Methods

add

(obj, [prefix])
Defined in lib/schema.js:88

Adds rules to the schema.

Parameters

method

(name, fn)
Defined in lib/schema.js:190

Adds a method.

Parameters

path

(name, [obj]) SchemaType | Virtual
Defined in lib/schema.js:127

Gets/Sets a schema path.

Parameters

Returns

post

(type, fn)
Defined in lib/schema.js:175

Adds a post-hook.

Parameters

  • type String

    Hook type. The value should be either save or remove.

  • fn Function

pre

(type, fn)
Defined in lib/schema.js:160

Adds a pre-hook.

Parameters

  • type String

    Hook type. The value should be either save or remove.

  • fn Function

static

(name, fn)
Defined in lib/schema.js:203

Adds a static method.

Parameters

virtual

(name, [method]) Warehouse.Virtual
Defined in lib/schema.js:147

Creates a virtual key.

Parameters

Returns

  • Warehouse.Virtual

Properties

Types

static
Defined in lib/schema.js:76

methods

Defined in lib/schema.js:38

The document methods of the schema.

posts

Defined in lib/schema.js:59

The post-hooks of the schema.

pres

Defined in lib/schema.js:47

The pre-hooks of the schema.

statics

Defined in lib/schema.js:29

The static methods of the schema.

tree

private
Defined in lib/schema.js:19

Schema tree.