Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased]
Added
- Lookup Stage - Join collections with type-safe DSL
- Simple lookups with equality matching
- Pipeline-based lookups with filtering and transformations
letvariables for accessing parent document fieldslookupAndMergehelper for flattening joined data- Support for multiple lookups in single pipeline
- Unwind Stage - Flatten array fields
preserveNullAndEmptyArraysoption- Works seamlessly with lookup results
- Add Fields Stage - Add computed fields to documents
- Support for expressions and calculations
- Array operations (sum, avg, min, max, size)
- String concatenation
- Conditional field creation with when expressions
- Expression System - Natural Kotlin operators for calculations
- Arithmetic operators:
*,+,-,/ - Works in group accumulators, addFields, and match
- Type-safe property references
- Arithmetic operators:
- Expr Support in Match - Complex field comparisons
- Compare fields to each other
- Use expressions in match conditions
- Variable references in lookup pipelines
- Type Conversion -
into()method for result type conversion- Convert at any pipeline stage
- Type-safe with
into<T>() - Support for KClass parameter
- Field Name Mapping - Respect
@Fieldannotations- Automatic handling of custom MongoDB field names
- Works across all builders (match, group, sort, etc.)
Changed
- Group Stage - Now auto-adds grouped fields to output
- Grouped fields appear at top level, not just in
_id - Uses
$addFieldsstage internally - Returns multiple stages for complete functionality
- Grouped fields appear at top level, not just in
- Sort Functions - Changed from infix to regular functions
Product::price.asc()instead ofProduct::price asc- Cleaner syntax without Unit parameter workaround
- ArrayOperation - Unified sealed class for group and addFields
- Shared logic between aggregation stages
- Consistent API across builders
Fixed
- Infix function compatibility issues with default parameters
- Public inline functions accessing internal/private members
- Type conversion issues in paginated results
[0.1.0-SNAPSHOT] - 2026-01-11
Added
- Initial project structure
- Core
Konductentry point class AggregationPipelineinterface with basic operationsmatchstage with comparison operators (eq, ne, gt, gte, lt, lte)matchstage with set operators (in, nin)matchstage with string operators (regex)matchstage with existence checks (exists, isNull, isNotNull)sortstage with ascending and descending orderskipandlimitstages for paginationgroupstage with accumulators (sum, avg, min, max, count, etc.)facetstage for multi-metric queriespaginatehelper with PagedResult wrappercustomStagebuilder for unsupported MongoDB stages- Terminal operations:
toList(),firstOrNull(),count() - Debug support:
toJson(),toAggregation() - Type-safe field references using Kotlin property references
- Extension function
MongoTemplate.konduct() - Comprehensive integration tests with Testcontainers
- Complete documentation with MkDocs + Dokka
Documentation
- User guides for all core features
- Real-world examples (e-commerce, analytics, time-series)
- API reference with Dokka
- Quick start guide
- Contributing guidelines
Migration Guides
From 0.1.0 to Current
Sort Syntax Changed:
Lookup Now Requires Type Conversion:
// Old (returned Order)
.lookup<Customer> { /* ... */ }
.toList() // List<Order>
// New (use into() to convert)
.lookup<Customer> { /* ... */ }
.into<Document>() // or .into<OrderWithCustomer>()
.toList()
Group Auto-Adds Fields:
// Now automatically includes grouped fields
.group {
by(Product::category)
accumulate { "count" count Unit }
}
// Result has both _id and category fields
Upgrade Instructions
Update Dependencies
Update Code
-
Fix sort syntax:
-
Add into() after lookup:
-
Update imports for new features:
What's Next?
See our roadmap for upcoming features:
- [ ] Window functions ($setWindowFields)
- [ ] Text search integration
- [ ] Geospatial queries
- [ ] Atlas Search support
- [ ] Performance optimizations
- [ ] More built-in patterns
Questions? Open an issue or discussion!