Class Query<T>Abstract

An abstract Query which allows retrieving results

Type Parameters

Hierarchy

Constructors

  • Type Parameters

    Parameters

    • entityManager: EntityManager

      The owning EntityManager of this query

    • resultClass: Class<T>

      The result class of this query

    Returns Query<T>

Properties

entityManager: EntityManager

The owning EntityManager of this query

resultClass: Class<T>

The result class of this query

MAX_URI_SIZE: 2000 = 2000

Methods

  • Parameters

    • limit: number

    Returns Node<T>

  • Parameters

    • offset: number

    Returns Node<T>

  • Parameters

    • field: string
    • order: 1 | -1

    Returns Node<T>

  • Parameters

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

    Returns Node<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<number>

  • 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>

  • Execute the query and return the query results as a List

    Note: All local unsaved changes on matching objects, will be discarded.

    Returns

    A promise that will be resolved with the query result as a list

    Parameters

    Returns Promise<T[]>

  • Execute the query and return the query results as a List

    Note: All local unsaved changes on matching objects, will be discarded.

    Returns

    A promise that will be resolved with the query result as a list

    Parameters

    • Optional doneCallback: ResultListCallback<T>

      Called when the operation succeed.

    • Optional failCallback: FailCallback

      Called when the operation failed.

    Returns Promise<T[]>

  • Execute the query that returns a single result

    Note: All local unsaved changes on the matched object, will be discarded.

    Returns

    A promise that will be resolved with the query result as a single result

    Parameters

    Returns Promise<null | T>

  • Execute the query that returns a single result

    Note: All local unsaved changes on the matched object, will be discarded.

    Returns

    A promise that will be resolved with the query result as a single result

    Parameters

    Returns Promise<null | 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>

Generated using TypeDoc