Skip to content

Commit

Permalink
Merge pull request #231 from JoachimM7/master/6.0
Browse files Browse the repository at this point in the history
support the .match(query)
  • Loading branch information
Joannis authored Apr 8, 2020
2 parents 3149130 + ce1d42d commit c125e74
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/MongoKitten/AggregateStage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ public struct AggregateBuilderStage {
"$match": query
])
}

public static func match<Q: MongoKittenQuery>(_ query: Q) -> AggregateBuilderStage {
return AggregateBuilderStage(document: [
"$match": query.makeDocument()
])
}

public static func addFields(_ query: Document) -> AggregateBuilderStage {
return AggregateBuilderStage(document: [
Expand Down

0 comments on commit c125e74

Please sign in to comment.