• Filters the documents from an async generator and yield them by the condition

    Type Parameters

    • T extends unknown

    Parameters

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

      The async generator to resolve documents from.

    • predicate: (value: T) => boolean | Promise<boolean>

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

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