Version 1.0.2. A TypeScript library for building MongoDB aggregation pipelines using a fluent builder pattern. Supports all major aggregation stages (Match, Group, Lookup, Bucket, etc.), expressions (toString, toDate, first, last, etc.), and custom helpers. Provides an object-oriented API with full type safety and auto-completion, reducing boilerplate and errors compared to raw MongoDB pipeline objects. Actively maintained with frequent releases. Differentiator: strongly typed builder ensures pipeline correctness at compile time.
npm install mongodb-aggregate-builderNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a MongoDB aggregation pipeline with match, addFields, sort, skip, and limit using the fluent builder.
Ensure match before group, etc.
Use aggBuilder.addFields(toString('field', 'alias')) instead of passing toString to match.Use SortDirection.ASC or SortDirection.DESC for numeric sorts; ASC_TEXT may not work as expected.
Ensure you use the correct variable: const builder = new AggregateBuilder(); builder.build();
Run: npm install mongodb-aggregate-builder
Update to latest version: npm install mongodb-aggregate-builder@latest
No dependency data recorded yet.