Function mapDocuments

  • Maps the documents from an async generator and yield them

    Type Parameters

    • T extends unknown
    • U = T

    Parameters

    • iterator: AsyncGenerator<T | T[], void, unknown>

      The async generator to resolve documents from.

    • callbackfn: ((value: T) => U | Promise<U>)
        • (value): U | Promise<U>
        • Parameters

          • value: T

          Returns U | Promise<U>

    Returns AsyncGenerator<Awaited<U>, void, unknown>

    • A promise that resolves to the flattened array of documents.