Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace queryHelper

Index

Functions

  • queryAll(dynamodb: DynamoDB, req: QueryInput): Promise<any[]>
  • Paginate through a query to collect all results.

    For large results this can use significantly more memory than queryByCallback.

    Parameters

    • dynamodb: DynamoDB

      The DynamoDB client instance to use.

    • req: QueryInput

      The query input.

    Returns Promise<any[]>

  • queryByCallback(dynamodb: DynamoDB, req: QueryInput, callback: (items: any[]) => boolean | Promise<boolean>): Promise<void>
  • Paginate through a query and pass each page of results to a callback. Pagination can be aborted by returning false (or a Promise that resolves to false) from the callback.

    For large results this can use significantly less memory than queryAll.

    Parameters

    • dynamodb: DynamoDB

      The DynamoDB client instance to use.

    • req: QueryInput

      The query input.

    • callback: (items: any[]) => boolean | Promise<boolean>

      A function that each page of results is passed to. Return false (or a Promise that resolves to false) to abort the query.

        • (items: any[]): boolean | Promise<boolean>
        • Parameters

          • items: any[]

          Returns boolean | Promise<boolean>

    Returns Promise<void>

  • queryCountAll(dynamodb: DynamoDB, req: QueryInput): Promise<number>
  • Paginate through a query to count all results. This is more efficient than queryAll when only the count is needed.

    Parameters

    • dynamodb: DynamoDB

      The DynamoDB client instance to use.

    • req: QueryInput

      The query input.

    Returns Promise<number>

Generated using TypeDoc