Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Query

Hierarchy

  • Query

Index

Constructors

constructor

  • new Query(runHandler?: function, data?: object): Query
  • new Query(runHandler?: function, data?: object): Query
  • Parameters

    Returns Query

  • Parameters

    • Optional runHandler: function
    • Optional data: object

    Returns Query

Properties

data

data: any

runHandler

runHandler: function

Type declaration

Static COMPARISON_OPERATORS

COMPARISON_OPERATORS: string[] = ['$eq','$gt','$gte','$in','$lt','$lte','$ne','$nin']

Static ELEMENT_OPERATORS

ELEMENT_OPERATORS: string[] = ['$exists']

Static LOGIC_OPERATORS

LOGIC_OPERATORS: string[] = ['$and','$or']

Methods

add

  • add(key: string, operator?: string, value?: any, logicalOperator?: string): this
  • add(key: string, operator?: string, value?: any, logicalOperator?: string): this
  • Parameters

    • key: string
    • Optional operator: string
    • Optional value: any
    • Optional logicalOperator: string

    Returns this

  • Parameters

    • key: string
    • Optional operator: string
    • Optional value: any
    • Optional logicalOperator: string

    Returns this

and

fields

  • fields(...fields: (string | string[])[]): this
  • fields(...fields: (string | string[])[]): this
  • Parameters

    • Rest ...fields: (string | string[])[]

    Returns this

  • Parameters

    • Rest ...fields: (string | string[])[]

    Returns this

limit

  • limit(value: number): this
  • limit(value: number): this
  • Parameters

    • value: number

    Returns this

  • Parameters

    • value: number

    Returns this

or

run

skip

  • skip(value: number): this
  • skip(value: number): this
  • Parameters

    • value: number

    Returns this

  • Parameters

    • value: number

    Returns this

sort

  • sort(key: string | any[], order?: number): this
  • sort(key: string | any[], order?: number): this
  • Parameters

    • key: string | any[]
    • Default value order: number = 1

    Returns this

  • Parameters

    • key: string | any[]
    • Optional order: number

    Returns this

toJSON

  • toJSON(): any
  • toJSON(): any
  • Returns any

  • Returns any

where

  • where(key: string, operator?: string, value?: any, logicalOperator?: string): WhereQuery
  • where(key: string, operator?: string, value?: any, logicalOperator?: string): WhereQuery
  • Parameters

    • key: string
    • Optional operator: string
    • Optional value: any
    • Optional logicalOperator: string

    Returns WhereQuery

  • Parameters

    • key: string
    • Optional operator: string
    • Optional value: any
    • Optional logicalOperator: string

    Returns WhereQuery