API Reference

SchemaType.String Class

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

Description

Schema type: String.

Constructor

SchemaType.String

([options])

Schema type: String.

Parameters

Methods

cast

(value) String
Inherited from SchemaType but overwritten in: lib/types/string.js:49

Casts the given value to a string.

Parameters

  • value Any

Returns

checkRequired

(value) Boolean
Inherited from SchemaType but overwritten in: lib/types/string.js:37

Checks if the given value is a string.

Parameters

  • value Any

Returns

compare

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

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