@@ -64,9 +64,27 @@ public struct Pipeline {
64
64
/// only additions are desired.
65
65
///
66
66
/// - Parameter selections: The fields to include in the output documents, specified as
67
- /// `Selectable` expressions or `String` values representing field names .
67
+ /// `Selectable` expressions.
68
68
/// - Returns: A new `Pipeline` object with this stage appended to the stage list.
69
- public func select( _ selections: SelectableOrFieldName ... ) -> Pipeline {
69
+ public func select( _ selections: Selectable ... ) -> Pipeline {
70
+ // Implementation
71
+ return self
72
+ }
73
+
74
+ /// Selects or creates a set of fields from the outputs of previous stages.
75
+ ///
76
+ /// The selected fields are defined using `Selectable` expressions, which can be:
77
+ ///
78
+ /// - `String`: Name of an existing field.
79
+ /// - `Field`: References an existing field.
80
+ /// - `Function`: Represents the result of a function with an assigned alias name using `Expr#as`.
81
+ ///
82
+ /// If no selections are provided, the output of this stage is empty. Use `addFields` instead if
83
+ /// only additions are desired.
84
+ ///
85
+ /// - Parameter selections: `String` values representing field names.
86
+ /// - Returns: A new `Pipeline` object with this stage appended to the stage list.
87
+ public func select( _ selections: String ... ) -> Pipeline {
70
88
// Implementation
71
89
return self
72
90
}
@@ -87,7 +105,7 @@ public struct Pipeline {
87
105
///
88
106
/// - Parameter condition: The `BooleanExpr` to apply.
89
107
/// - Returns: A new `Pipeline` object with this stage appended to the stage list.
90
- public func `where`( _ condition: BooleanExpr ) -> Pipeline {
108
+ public func `where`( _ condition: ( ) -> BooleanExpr ) -> Pipeline {
91
109
return self
92
110
}
93
111
@@ -131,8 +149,26 @@ public struct Pipeline {
131
149
/// `Expr.alias(_:)`.
132
150
///
133
151
/// - Parameter selections: The fields to include in the output documents, specified as
134
- /// `Selectable` expressions or `String` values representing field names.
135
- public func distinct( _ groups: SelectableOrFieldName ... ) -> Pipeline {
152
+ /// `String` values representing field names.
153
+ public func distinct( _ groups: String ... ) -> Pipeline {
154
+ return self
155
+ }
156
+
157
+ /// Returns a set of distinct `Expr` values from the inputs to this stage.
158
+ ///
159
+ /// This stage processes the results from previous stages, ensuring that only unique
160
+ /// combinations of `Expr` values (such as `Field` and `Function`) are included.
161
+ ///
162
+ /// The parameters to this stage are defined using `Selectable` expressions or field names:
163
+ ///
164
+ /// - `String`: The name of an existing field.
165
+ /// - `Field`: A reference to an existing document field.
166
+ /// - `Function`: Represents the result of a function with an assigned alias using
167
+ /// `Expr.alias(_:)`.
168
+ ///
169
+ /// - Parameter selections: The fields to include in the output documents, specified as
170
+ /// `Selectable` expressions.
171
+ public func distinct( _ groups: Selectable ... ) -> Pipeline {
136
172
return self
137
173
}
138
174
@@ -188,7 +224,7 @@ public struct Pipeline {
188
224
///
189
225
/// - Parameter orderings: One or more `Ordering` instances specifying the sorting criteria.
190
226
/// - Returns: A new `Pipeline` object with this stage appended to the stage list.
191
- public func sort( _ orderings: [ Ordering ] ) -> Pipeline {
227
+ public func sort( _ orderings: Ordering ... ) -> Pipeline {
192
228
// Implementation
193
229
return self
194
230
}
@@ -200,7 +236,19 @@ public struct Pipeline {
200
236
///
201
237
/// - Parameter field: The `Selectable` field containing the nested map.
202
238
/// - Returns: A new `Pipeline` object with this stage appended to the stage list.
203
- public func replace( _ field: SelectableOrFieldName ) -> Pipeline {
239
+ public func replace( _ field: Selectable ) -> Pipeline {
240
+ // Implementation
241
+ return self
242
+ }
243
+
244
+ /// Fully overwrites all fields in a document with those coming from a nested map.
245
+ ///
246
+ /// This stage allows you to emit a map value as a document. Each key of the map becomes a
247
+ /// field on the document that contains the corresponding value.
248
+ ///
249
+ /// - Parameter fieldName: The field containing the nested map.
250
+ /// - Returns: A new `Pipeline` object with this stage appended to the stage list.
251
+ public func replace( _ fieldName: String ) -> Pipeline {
204
252
// Implementation
205
253
return self
206
254
}
0 commit comments