API Reference

SchemaType.Object Class

Defined in lib/types/object.js:4
Extends SchemaType

Description

Schema type: Object

Constructor

SchemaType.Object

([options])

Schema type: Object

Parameters

Methods

cast

(value) Any
Inherited from : lib/schematype.js:89

Casts a value.

Parameters

  • value Any

Returns

  • Any

checkRequired

(value) Any
Inherited from : lib/schematype.js:77

Validates a value.

Parameters

  • value Any

Returns

  • Any

compare

(data, value) Boolean
Inherited from SchemaType but overwritten in: lib/types/object.js:41

Compares data.

Parameters

Returns

q$exists

(data, value) Boolean
Inherited from : lib/schematype.js:126

Checks whether the field exists.

q$exists is also aliased as q$exist.

Parameters

  • data Any
  • value Any

Returns

q$gt

(data, value) Boolean
Inherited from : lib/schematype.js:182

Checks whether data is greater than value.

Parameters

  • data Any
  • value Any

Returns

q$gte

(data, value) Boolean
Inherited from : lib/schematype.js:195

Checks whether data is greater than or equal to value.

q$gte is also aliased as q$min.

Parameters

  • data Any
  • value Any

Returns

q$in

(data, value) Boolean
Inherited from : lib/schematype.js:210

Checks whether data contains value.

Parameters

  • data Any
  • value Any

Returns

q$lt

(data, value) Boolean
Inherited from : lib/schematype.js:154

Checks whether data is less than value.

Parameters

  • data Any
  • value Any

Returns

q$lte

(data, value) Boolean
Inherited from : lib/schematype.js:167

Checks whether data is less than or equal to value.

q$lte is also aliased as q$max.

Parameters

  • data Any
  • value Any

Returns

q$ne

(data, value) Boolean
Inherited from : lib/schematype.js:141

Checks whether data is equal to value. If not, return true.

Parameters

  • data Any
  • value Any

Returns

q$nin

(data, value) Boolean
Inherited from : lib/schematype.js:229

Checks whether data not contains value.

Parameters

  • data Any
  • value Any

Returns

q$where

(data, value) Boolean
Inherited from : lib/schematype.js:274

Validates data with value function.

Parameters

Returns

q$within

(data, value) Boolean
Inherited from : lib/schematype.js:248

Checks whether data is between value.

Parameters

Returns

q$without

(data, value) Boolean
Inherited from : lib/schematype.js:261

Checks whether data is not between value.

Parameters

Returns

save

(value) Any
Inherited from : lib/schematype.js:101

Transforms a value into JSON.

Parameters

  • value Any

Returns

  • Any

Properties

default

Inherited from : lib/schematype.js:54

The default value of the field.

required

Inherited from : lib/schematype.js:66

Determines whether the field is required.

type

static