import { Document } from '@tashmet/tashmet'; import { AggregatorFactory, OperatorPluginConfigurator } from '@tashmet/engine'; import { Container, Logger } from '@tashmet/core'; import { MingoOperatorContext } from './operator.js'; /** * Pipeline operators * * Since mingo does not support async interators we provide a means to go * around that limitation by allowing at least a subset of pipeline * operators to be streamed asynchronously, with the rest being async but * with buffering of the previous step. */ export declare class MingoStreamPipelineOpertors { private factory; private logger; constructor(factory: AggregatorFactory, logger: Logger); /** * Handler for all mingo pipeline operators that can be streamed. * * This generator will take one document at a time from the input and pass it * to the mingo operator as a list with a single item. All documents from the * result iterator will be yielded before continuing reading the next document * from the input. */ operatorStreamed(source: AsyncIterable, expr: any, ctx: MingoOperatorContext): AsyncGenerator; /** * Handler for all mingo pipeline operators that can not be streamed * * This generator will load a buffer of all documents from the input and then * proceed by passing that buffer to the mingo operator. the resulting * documents will be yielded one by one once the whole operation is done. */ operatorBuffered(source: AsyncIterable, expr: any, ctx: MingoOperatorContext): AsyncGenerator; /** Custom $match operator that enables streaming */ $match(source: AsyncIterable, expr: Document, ctx: MingoOperatorContext): AsyncGenerator; /** * Since mingo seems to not take into account that replaceWith has a * different form than replaceRoot, we override it. */ $replaceWith(source: AsyncIterable, expr: Document, ctx: MingoOperatorContext): AsyncGenerator; /** Custom $skip operator that enables streaming */ $skip(source: AsyncIterable, expr: number): AsyncGenerator; /** Custom $limit operator that enables streaming */ $limit(source: AsyncIterable, expr: number): AsyncGenerator; /** No support for $documents operator in mingo so we provide our own */ $documents(source: AsyncIterable, expr: Document[]): AsyncGenerator; /** Custom operator to allow for update expresssions in an aggregation pipeline */ $update(source: AsyncIterable, expr: any): AsyncGenerator; $facet(source: AsyncIterable, expr: Document): AsyncGenerator; $dump(source: AsyncIterable, expr: any, ctx: MingoOperatorContext): AsyncGenerator; $log(source: AsyncIterable, expr: any, ctx: MingoOperatorContext): AsyncGenerator; } declare const _default: () => (container: Container) => OperatorPluginConfigurator; export default _default;