Enum schema type.

Hierarchy (View Summary)

Constructors

  • Parameters

    • name: string
    • Optionaloptions: Partial<{ default?: any[] | () => any[]; required: boolean }> & {
          elements?: any[];
      }
      • required
      • elements
      • default
      • Optionalelements?: any[]

    Returns default

Properties

default: () => any[]
name: string = ''
options: { default?: any[] | () => any[]; required: boolean } & {
    elements: any[];
}
q$exists: (value: unknown, query: unknown, data?: unknown) => boolean

Type declaration

    • (value: unknown, query: unknown, data?: unknown): boolean
    • Checks the existance of data.

      Parameters

      • value: unknown
      • query: unknown
      • Optionaldata: unknown

      Returns boolean

q$max: (value: unknown, query: unknown, data?: unknown) => boolean

Type declaration

    • (value: unknown, query: unknown, data?: unknown): boolean
    • Checks whether value is less than or equal to (i.e. <=) the query.

      Parameters

      • value: unknown
      • query: unknown
      • Optionaldata: unknown

      Returns boolean

q$min: (value: unknown, query: unknown, data?: unknown) => boolean

Type declaration

    • (value: unknown, query: unknown, data?: unknown): boolean
    • Checks whether value is greater than or equal to (i.e. >=) the query.

      Parameters

      • value: unknown
      • query: unknown
      • Optionaldata: unknown

      Returns boolean

Methods

  • Casts data. This function is used by getters to cast an object to document instances. If the value is null, the default value will be returned.

    Parameters

    • Optionalvalue: unknown
    • Optionaldata: unknown

    Returns unknown

  • Compares data. This function is used when sorting.

    Parameters

    • a: unknown
    • b: unknown

    Returns number

  • Checks the equality of data.

    Parameters

    • value: any[]
    • query: unknown
    • Optionaldata: unknown

    Returns boolean

  • Parses data. This function is used when restoring data from database files.

    Parameters

    • value: unknown

    Returns any

  • Checks the existance of data.

    Parameters

    • value: unknown
    • query: unknown
    • Optionaldata: unknown

    Returns boolean

  • Checks whether value is greater than (i.e. >) the query.

    Parameters

    • value: unknown
    • query: unknown
    • Optionaldata: unknown

    Returns boolean

  • Checks whether value is greater than or equal to (i.e. >=) the query.

    Parameters

    • value: unknown
    • query: unknown
    • Optionaldata: unknown

    Returns boolean

  • Checks whether value is equal to one of elements in query.

    Parameters

    • value: unknown
    • query: unknown[]
    • Optionaldata: unknown

    Returns boolean

  • Checks whether value is less than (i.e. <) the query.

    Parameters

    • value: unknown
    • query: unknown
    • Optionaldata: unknown

    Returns boolean

  • Checks whether value is less than or equal to (i.e. <=) the query.

    Parameters

    • value: unknown
    • query: unknown
    • Optionaldata: unknown

    Returns boolean

  • Checks the equality of data. Returns true if the value doesn't match.

    Parameters

    • value: any[]
    • query: unknown
    • Optionaldata: unknown

    Returns boolean

  • Checks whether value is not equal to any elements in query.

    Parameters

    • value: unknown
    • query: unknown[]
    • Optionaldata: unknown

    Returns boolean

  • Renames a field.

    Parameters

    • value: unknown
    • update: string
    • data: unknown

    Returns void

  • Sets the value.

    Type Parameters

    • T

    Parameters

    • value: unknown
    • update: T
    • Optionaldata: unknown

    Returns T

  • Unsets the value.

    Type Parameters

    • T

    Parameters

    • value: T
    • update: boolean
    • Optionaldata: unknown

    Returns T

  • Validates data. The value must be one of elements set in the options.

    Parameters

    • value_: unknown
    • Optionaldata: unknown

    Returns unknown

  • Transforms value. This function is used when saving data to database files.

    Parameters

    • value: unknown
    • Optionaldata: unknown

    Returns any