Skip to content

Commit

Permalink
Support aggregate Group, fix header doc typo
Browse files Browse the repository at this point in the history
  • Loading branch information
marcuswu0814 committed Nov 6, 2024
1 parent ab34b48 commit f86d799
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Sources/MongoKitten/AggregateStage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ public struct AddFields: AggregateBuilderStage {

/// A $group stage in an aggregation pipeline, used to group documents
/// - SeeAlso: https://docs.mongodb.com/manual/reference/operator/aggregation/group/
public struct Group: AggregateBuilderStage {
public internal(set) var stage: Document
public internal(set) var minimalVersionRequired: WireVersion? = nil

public init(_ document: Document) {
self.stage = ["$group": document]
}
}

/// A $project stage in an aggregation pipeline, used to project documents
/// - SeeAlso: https://docs.mongodb.com/manual/reference/operator/aggregation/project/
public struct Project: AggregateBuilderStage {
public internal(set) var stage: Document
public internal(set) var minimalVersionRequired: WireVersion?
Expand Down

0 comments on commit f86d799

Please sign in to comment.