Skip to content

Commit 1137c6d

Browse files
committed
change APIs
1 parent 8506ce9 commit 1137c6d

File tree

5 files changed

+8
-25
lines changed

5 files changed

+8
-25
lines changed

Firestore/Swift/Source/ExprImpl.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,6 @@ public extension Expression {
283283
return FunctionExpression("str_concat", [self] + strings)
284284
}
285285

286-
func strConcat(_ strings: [String]) -> FunctionExpression {
287-
let exprs = [self] + strings.map { Helper.sendableToExpr($0) }
288-
return FunctionExpression("str_concat", exprs)
289-
}
290-
291286
func reverse() -> FunctionExpression {
292287
return FunctionExpression("reverse", [self])
293288
}

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

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ public protocol Expression: Sendable {
739739
/// Assumes `self` evaluates to a string.
740740
///
741741
/// ```swift
742-
/// // Convert the "title" field to uppercase
742+
/// // Convert the "title" field to uppercase3
743743
/// Field("title").uppercased()
744744
/// ```
745745
///
@@ -772,19 +772,6 @@ public protocol Expression: Sendable {
772772
/// - Returns: A new `FunctionExpression` representing the concatenated string.
773773
func strConcat(_ strings: [Expression]) -> FunctionExpression
774774

775-
/// Creates an expression that concatenates this string expression with other string literals.
776-
/// Assumes `self` evaluates to a string.
777-
///
778-
/// ```swift
779-
/// // Combine "firstName" field with " " and "lastName"
780-
/// Field("firstName").strConcat(" ", "lastName")
781-
/// ```
782-
///
783-
/// - Parameter secondString: A string literal to concatenate.
784-
/// - Parameter otherStrings: Optional additional string literals to concatenate.
785-
/// - Returns: A new `FunctionExpression` representing the concatenated string.
786-
func strConcat(_ strings: [String]) -> FunctionExpression
787-
788775
/// Creates an expression that reverses this string expression.
789776
/// Assumes `self` evaluates to a string.
790777
///

Firestore/Swift/Source/SwiftAPI/Pipeline/Expressions/FunctionExpressions/BooleanExpression.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ public class BooleanExpression: FunctionExpression, @unchecked Sendable {
2121
return AggregateFunction("count_if", [self])
2222
}
2323

24-
public func then(_ thenExpr: Expression, else elseExpr: Expression) -> FunctionExpression {
25-
return FunctionExpression("cond", [self, thenExpr, elseExpr])
24+
public func then(_ thenExpression: Expression,
25+
else elseExpression: Expression) -> FunctionExpression {
26+
return FunctionExpression("cond", [self, thenExpression, elseExpression])
2627
}
2728

2829
public static func && (lhs: BooleanExpression,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ public struct Pipeline: @unchecked Sendable {
265265
/// // let pipeline: Pipeline = ... // Assume initial pipeline, possibly sorted.
266266
/// // Retrieve the second page of 20 results (skip first 20, limit to next 20).
267267
/// let pagedPipeline = pipeline
268-
/// .sort(Ascending("published")) // Example sort.
268+
/// .sort(Field("published").ascending()) // Example sort.
269269
/// .offset(20) // Skip the first 20 results.
270270
/// .limit(20) // Take the next 20 results.
271271
/// // let results = try await pagedPipeline.execute()
@@ -627,7 +627,7 @@ public struct Pipeline: @unchecked Sendable {
627627
/// - params: An array of ordered, `Sendable` parameters for the stage.
628628
/// - options: Optional dictionary of named, `Sendable` parameters.
629629
/// - Returns: A new `Pipeline` object with this stage appended.
630-
public func rawStage(name: String, params: [Sendable?],
630+
public func rawStage(name: String, params: [Sendable],
631631
options: [String: Sendable]? = nil) -> Pipeline {
632632
return Pipeline(
633633
stages: stages + [RawStage(name: name, params: params, options: options)],

Firestore/Swift/Source/SwiftAPI/Stages.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,10 @@ class Unnest: Stage {
349349
class RawStage: Stage {
350350
let name: String
351351
let bridge: StageBridge
352-
private var params: [Sendable?]
352+
private var params: [Sendable]
353353
private var options: [String: Sendable]?
354354

355-
init(name: String, params: [Sendable?], options: [String: Sendable]? = nil) {
355+
init(name: String, params: [Sendable], options: [String: Sendable]? = nil) {
356356
self.name = name
357357
self.params = params
358358
self.options = options

0 commit comments

Comments
 (0)