Function pickDocuments

A function that picks a subset of documents from an array of documents, given a limit and offset.

  • Type Parameters

    • T extends unknown

      The type of the documents in the array.

    Parameters

    • limit: number

      The maximum number of documents to pick.

    • offset: number

      The number of documents to skip before picking.

    Returns ((rows?: T[]) => {
        done: boolean;
        rows: T[];
    })

    • A function that takes an array of documents and returns an object with rows and done properties. The rows property contains the picked documents, and done property indicates if the picking is finished.
      • (rows?): {
            done: boolean;
            rows: T[];
        }
      • Parameters

        • rows: T[] = []

        Returns {
            done: boolean;
            rows: T[];
        }

        • done: boolean
        • rows: T[]