Skip to content

Commit 8506ce9

Browse files
committed
add at least one restriction in the documentation
1 parent 8ea2d64 commit 8506ce9

File tree

2 files changed

+25
-37
lines changed

2 files changed

+25
-37
lines changed

Firestore/Swift/Source/SwiftAPI/Pipeline/Expression.swift

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,7 @@ public protocol Expression: Sendable {
185185
/// // Combine the "items" array with "otherItems" and "archiveItems" array fields.
186186
/// Field("items").arrayConcat(Field("otherItems"), Field("archiveItems"))
187187
/// ```
188-
/// - Parameter secondArray: An `Expression` (evaluating to an array) to concatenate.
189-
/// - Parameter otherArrays: Optional additional `Expression` values (evaluating to arrays) to
188+
/// - Parameter arrays: An array of at least one `Expression` (evaluating to an array) to
190189
/// concatenate.
191190
/// - Returns: A new `FunctionExpression` representing the concatenated array.
192191
func arrayConcat(_ arrays: [Expression]) -> FunctionExpression
@@ -199,9 +198,7 @@ public protocol Expression: Sendable {
199198
/// // Combine "tags" (an array field) with ["new", "featured"] and ["urgent"]
200199
/// Field("tags").arrayConcat(["new", "featured"], ["urgent"])
201200
/// ```
202-
/// - Parameter secondArray: An array literal of `Sendable` values to concatenate.
203-
/// - Parameter otherArrays: Optional additional array literals of `Sendable` values to
204-
/// concatenate.
201+
/// - Parameter arrays: An array of at least one `Sendable` values to concatenate.
205202
/// - Returns: A new `FunctionExpression` representing the concatenated array.
206203
func arrayConcat(_ arrays: [[Sendable]]) -> FunctionExpression
207204

@@ -255,8 +252,7 @@ public protocol Expression: Sendable {
255252
/// Field("tags").arrayContainsAll(["urgent", "review"])
256253
/// ```
257254
///
258-
/// - Parameter values: A list of `Sendable` literal elements to check for in the array
259-
/// represented by `self`.
255+
/// - Parameter values: An array of at least one `Sendable` element to check for in the array.
260256
/// - Returns: A new `BooleanExpr` representing the "array_contains_all" comparison.
261257
func arrayContainsAll(_ values: [Sendable]) -> BooleanExpression
262258

@@ -269,8 +265,7 @@ public protocol Expression: Sendable {
269265
/// Field("userGroups").arrayContainsAny([Field("allowedGroup1"), Field("allowedGroup2")])
270266
/// ```
271267
///
272-
/// - Parameter values: A list of `Expression` elements to check for in the array represented
273-
/// by `self`.
268+
/// - Parameter values: A list of `Expression` elements to check for in the array.
274269
/// - Returns: A new `BooleanExpr` representing the "array_contains_any" comparison.
275270
func arrayContainsAny(_ values: [Expression]) -> BooleanExpression
276271

@@ -283,8 +278,7 @@ public protocol Expression: Sendable {
283278
/// Field("categories").arrayContainsAny(["electronics", "books"])
284279
/// ```
285280
///
286-
/// - Parameter values: A list of `Sendable` literal elements to check for in the array
287-
/// represented by `self`.
281+
/// - Parameter values: An array of at least one `Sendable` element to check for in the array.
288282
/// - Returns: A new `BooleanExpr` representing the "array_contains_any" comparison.
289283
func arrayContainsAny(_ values: [Sendable]) -> BooleanExpression
290284

@@ -425,7 +419,7 @@ public protocol Expression: Sendable {
425419
/// Field("categoryID").eqAny([Field("featuredCategory"), Field("popularCategory")])
426420
/// ```
427421
///
428-
/// - Parameter others: A list of `Expression` values to check against.
422+
/// - Parameter others: An array of at least one `Expression` value to check against.
429423
/// - Returns: A new `BooleanExpr` representing the "IN" comparison (eq_any).
430424
func eqAny(_ others: [Expression]) -> BooleanExpression
431425

@@ -438,7 +432,7 @@ public protocol Expression: Sendable {
438432
/// Field("category").eqAny(["Electronics", "Books", "Home Goods"])
439433
/// ```
440434
///
441-
/// - Parameter others: A list of `Sendable` literal values to check against.
435+
/// - Parameter others: An array of at least one `Sendable` literal value to check against.
442436
/// - Returns: A new `BooleanExpr` representing the "IN" comparison (eq_any).
443437
func eqAny(_ others: [Sendable]) -> BooleanExpression
444438

@@ -451,7 +445,7 @@ public protocol Expression: Sendable {
451445
/// Field("statusValue").notEqAny([Field("archivedStatus"), Field("deletedStatus")])
452446
/// ```
453447
///
454-
/// - Parameter others: A list of `Expression` values to check against.
448+
/// - Parameter others: An array of at least one `Expression` value to check against.
455449
/// - Returns: A new `BooleanExpr` representing the "NOT IN" comparison (not_eq_any).
456450
func notEqAny(_ others: [Expression]) -> BooleanExpression
457451

@@ -464,7 +458,7 @@ public protocol Expression: Sendable {
464458
/// Field("status").notEqAny(["pending", "archived"])
465459
/// ```
466460
///
467-
/// - Parameter others: A list of `Sendable` literal values to check against.
461+
/// - Parameter others: An array of at least one `Sendable` literal value to check against.
468462
/// - Returns: A new `BooleanExpr` representing the "NOT IN" comparison (not_eq_any).
469463
func notEqAny(_ others: [Sendable]) -> BooleanExpression
470464

@@ -1060,8 +1054,7 @@ public protocol Expression: Sendable {
10601054
/// Field("val1").logicalMaximum(Field("val2"), Field("val3"))
10611055
/// ```
10621056
///
1063-
/// - Parameter second: The second `Expr` to compare with.
1064-
/// - Parameter others: Optional additional `Expr` values to compare with.
1057+
/// - Parameter expressions: An array of at least one `Expression` to compare with.
10651058
/// - Returns: A new `FunctionExpression` representing the logical max operation.
10661059
func logicalMaximum(_ expressions: [Expression]) -> FunctionExpression
10671060

@@ -1073,8 +1066,7 @@ public protocol Expression: Sendable {
10731066
/// Field("val1").logicalMaximum(100, 200.0)
10741067
/// ```
10751068
///
1076-
/// - Parameter second: The second literal `Sendable` value to compare with.
1077-
/// - Parameter others: Optional additional literal `Sendable` values to compare with.
1069+
/// - Parameter values: An array of at least one `Sendable` value to compare with.
10781070
/// - Returns: A new `FunctionExpression` representing the logical max operation.
10791071
func logicalMaximum(_ values: [Sendable]) -> FunctionExpression
10801072

@@ -1086,8 +1078,7 @@ public protocol Expression: Sendable {
10861078
/// Field("val1").logicalMinimum(Field("val2"), Field("val3"))
10871079
/// ```
10881080
///
1089-
/// - Parameter second: The second `Expr` to compare with.
1090-
/// - Parameter others: Optional additional `Expr` values to compare with.
1081+
/// - Parameter expressions: An array of at least one `Expression` to compare with.
10911082
/// - Returns: A new `FunctionExpression` representing the logical min operation.
10921083
func logicalMinimum(_ expressions: [Expression]) -> FunctionExpression
10931084

@@ -1099,8 +1090,7 @@ public protocol Expression: Sendable {
10991090
/// Field("val1").logicalMinimum(0, -5.5)
11001091
/// ```
11011092
///
1102-
/// - Parameter second: The second literal `Sendable` value to compare with.
1103-
/// - Parameter others: Optional additional literal `Sendable` values to compare with.
1093+
/// - Parameter values: An array of at least one `Sendable` value to compare with.
11041094
/// - Returns: A new `FunctionExpression` representing the logical min operation.
11051095
func logicalMinimum(_ values: [Sendable]) -> FunctionExpression
11061096

Firestore/Swift/Source/SwiftAPI/Pipeline/Pipeline.swift

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ public struct Pipeline: @unchecked Sendable {
135135
/// // let results = try await updatedPipeline.execute()
136136
/// ```
137137
///
138-
/// - Parameter fields: The fields to add to the documents, specified as an array of
139-
/// `AliasedExpression`.
138+
/// - Parameter fields: An array of at least one `AliasedExpression` to add to the documents.
140139
/// - Returns: A new `Pipeline` object with this stage appended.
141140
public func addFields(_ fields: [AliasedExpression]) -> Pipeline {
142141
return Pipeline(stages: stages + [AddFields(fields: fields)], db: db)
@@ -151,7 +150,7 @@ public struct Pipeline: @unchecked Sendable {
151150
/// // let results = try await updatedPipeline.execute()
152151
/// ```
153152
///
154-
/// - Parameter fields: An array of `Field` instances to remove.
153+
/// - Parameter fields: An array of at least one `Field` instance to remove.
155154
/// - Returns: A new `Pipeline` object with this stage appended.
156155
public func removeFields(_ fields: [Field]) -> Pipeline {
157156
return Pipeline(
@@ -169,7 +168,7 @@ public struct Pipeline: @unchecked Sendable {
169168
/// // let results = try await updatedPipeline.execute()
170169
/// ```
171170
///
172-
/// - Parameter fields: An array of field names to remove.
171+
/// - Parameter fields: An array of at least one field name to remove.
173172
/// - Returns: A new `Pipeline` object with this stage appended.
174173
public func removeFields(_ fields: [String]) -> Pipeline {
175174
return Pipeline(
@@ -200,8 +199,8 @@ public struct Pipeline: @unchecked Sendable {
200199
/// // let results = try await projectedPipeline.execute()
201200
/// ```
202201
///
203-
/// - Parameter selections: An array of `Selectable` expressions to include in the output
204-
/// documents.
202+
/// - Parameter selections: An array of at least one `Selectable` expression to include in the
203+
/// output documents.
205204
/// - Returns: A new `Pipeline` object with this stage appended.
206205
public func select(_ selections: [Selectable]) -> Pipeline {
207206
return Pipeline(
@@ -221,7 +220,8 @@ public struct Pipeline: @unchecked Sendable {
221220
/// // let results = try await projectedPipeline.execute()
222221
/// ```
223222
///
224-
/// - Parameter selections: An array of field names to include in the output documents.
223+
/// - Parameter selections: An array of at least one field name to include in the output
224+
/// documents.
225225
/// - Returns: A new `Pipeline` object with this stage appended.
226226
public func select(_ selections: [String]) -> Pipeline {
227227
let selections = selections.map { Field($0) }
@@ -314,8 +314,7 @@ public struct Pipeline: @unchecked Sendable {
314314
/// // let results = try await distinctAuthorsGenresPipeline.execute()
315315
/// ```
316316
///
317-
/// - Parameter group: The name of the first field for distinct value combinations.
318-
/// - Parameter additionalGroups: Optional additional field names.
317+
/// - Parameter groups: An array of at least one field name for distinct value combinations.
319318
/// - Returns: A new `Pipeline` object with this stage appended.
320319
public func distinct(_ groups: [String]) -> Pipeline {
321320
let selections = groups.map { Field($0) }
@@ -344,8 +343,7 @@ public struct Pipeline: @unchecked Sendable {
344343
/// // let results = try await distinctPipeline.execute()
345344
/// ```
346345
///
347-
/// - Parameter group: The first `Selectable` expression to consider.
348-
/// - Parameter additionalGroups: Optional additional `Selectable` expressions.
346+
/// - Parameter groups: An array of at least one `Selectable` expression to consider.
349347
/// - Returns: A new `Pipeline` object with this stage appended.
350348
public func distinct(_ groups: [Selectable]) -> Pipeline {
351349
return Pipeline(stages: stages + [Distinct(groups: groups)], db: db)
@@ -377,7 +375,7 @@ public struct Pipeline: @unchecked Sendable {
377375
/// ```
378376
///
379377
/// - Parameters:
380-
/// - accumulator: An array of at least one `AggregateWithAlias` expressions for calculations.
378+
/// - aggregates: An array of at least one `AliasedAggregate` expression for calculations.
381379
/// - groups: Optional array of `Selectable` expressions for grouping. If `nil` or empty,
382380
/// aggregates across all documents.
383381
/// - Returns: A new `Pipeline` object with this stage appended.
@@ -446,7 +444,7 @@ public struct Pipeline: @unchecked Sendable {
446444
/// // let results = try await sortedPipeline.execute()
447445
/// ```
448446
///
449-
/// - Parameter orderings: An array of `Ordering` criteria.
447+
/// - Parameter orderings: An array of at least one `Ordering` criterion.
450448
/// - Returns: A new `Pipeline` object with this stage appended.
451449
public func sort(_ orderings: [Ordering]) -> Pipeline {
452450
return Pipeline(stages: stages + [Sort(orderings: orderings)], db: db)
@@ -556,7 +554,7 @@ public struct Pipeline: @unchecked Sendable {
556554
/// // let results = try await combinedPipeline.execute()
557555
/// ```
558556
///
559-
/// - Parameter other: The other `Pipeline` whose documents will be unioned.
557+
/// - Parameter other: An array of at least one `Pipeline` whose documents will be unioned.
560558
/// - Returns: A new `Pipeline` object with this stage appended.
561559
public func union(with other: Pipeline) -> Pipeline {
562560
return Pipeline(stages: stages + [Union(other: other)], db: db)

0 commit comments

Comments
 (0)