Class Operator<T>

An Operator saves the state of a combined query

Type Parameters

Hierarchy

Constructors

  • Type Parameters

    Parameters

    • entityManager: EntityManager

      The owning entity manager of this query

    • resultClass: Class<T>

      The query result class

    • operator: string

      The operator used to join the childes

    • childes: Node<T>[]

      The childes to join

    Returns Operator<T>

Properties

childes: Node<T>[]

The child Node of this query, it is always one

entityManager: EntityManager

The owning EntityManager of this query

firstResult: number = 0

The offset how many results should be skipped

maxResults: number = -1

The limit how many objects should be returned

operator: string

The operator used to join the child queries

order: {
    [field: string]: 1 | -1;
} = {}

The properties which should be used sort the result

Type declaration

  • [field: string]: 1 | -1
resultClass: Class<T>

The result class of this query

MAX_URI_SIZE: 2000 = 2000

Methods

  • Parameters

    • limit: number

    Returns Operator<T>

  • Parameters

    • offset: number

    Returns Operator<T>

  • Parameters

    • fieldOrSort: string | {
          [field: string]: 1 | -1;
      }
    • Optional order: 1 | -1

    Returns Operator<T>

  • Add an ascending sort for the specified field to this query

    Returns

    The resulting Query

    Parameters

    • field: string

      The field to sort

    Returns Node<T>

  • Execute the query that returns the matching objects count.

    Returns

    The total number of matched objects

    Parameters

    • Optional doneCallback: CountCallback

      Called when the operation succeed.

    • Optional failCallback: FailCallback

      Called when there is a server-side error

    Returns Promise<any>

  • Add an decending sort for the specified field to this query

    Returns

    The resulting Query

    Parameters

    • field: string

      The field to sort

    Returns Node<T>

  • Sets the sort of the query and discard all existing paramaters

    Returns

    The resulting Query

    See

    http://docs.mongodb.org/manual/reference/method/cursor.sort/

    Parameters

    • sort: {
          [field: string]: 1 | -1;
      }

      The new sort of the query which is an object whose keys are fields and the values are either +1 for ascending order or -1 for descending order

      • [field: string]: 1 | -1

    Returns Node<T>

  • Returns {
        [operator: string]: Node<T>[];
    }

    • [operator: string]: Node<T>[]

Generated using TypeDoc