Skip to content

Commit 176d31f

Browse files
committed
change some of the public APIs
1 parent 0227afe commit 176d31f

File tree

6 files changed

+19
-20
lines changed

6 files changed

+19
-20
lines changed

Firestore/Swift/Source/ExprImpl.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ public extension Expression {
129129
return BooleanExpression("gt", [self, exprOther])
130130
}
131131

132-
func greaterThanOrEqualTo(_ other: Expression) -> BooleanExpression {
132+
func greaterThanOrEqual(_ other: Expression) -> BooleanExpression {
133133
return BooleanExpression("gte", [self, other])
134134
}
135135

136-
func greaterThanOrEqualTo(_ other: Sendable) -> BooleanExpression {
136+
func greaterThanOrEqual(_ other: Sendable) -> BooleanExpression {
137137
let exprOther = Helper.sendableToExpr(other)
138138
return BooleanExpression("gte", [self, exprOther])
139139
}
@@ -147,11 +147,11 @@ public extension Expression {
147147
return BooleanExpression("lt", [self, exprOther])
148148
}
149149

150-
func lessThanOrEqualTo(_ other: Expression) -> BooleanExpression {
150+
func lessThanOrEqual(_ other: Expression) -> BooleanExpression {
151151
return BooleanExpression("lte", [self, other])
152152
}
153153

154-
func lessThanOrEqualTo(_ other: Sendable) -> BooleanExpression {
154+
func lessThanOrEqual(_ other: Sendable) -> BooleanExpression {
155155
let exprOther = Helper.sendableToExpr(other)
156156
return BooleanExpression("lte", [self, exprOther])
157157
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
// limitations under the License.
1414

1515
public struct AliasedExpression: Selectable, SelectableWrapper, Sendable {
16-
public let alias: String
16+
let alias: String
1717

18-
public let expr: Expression
18+
let expr: Expression
1919

2020
init(_ expr: Expression, _ alias: String) {
2121
self.alias = alias

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,14 +371,14 @@ public protocol Expression: Sendable {
371371
///
372372
/// - Parameter other: The expression to compare against.
373373
/// - Returns: A `BooleanExpr` that can be used in `where` clauses.
374-
func greaterThanOrEqualTo(_ other: Expression) -> BooleanExpression
374+
func greaterThanOrEqual(_ other: Expression) -> BooleanExpression
375375

376376
/// Creates a `BooleanExpr` that returns `true` if this expression is
377377
/// greater than or equal to the given value.
378378
///
379379
/// - Parameter other: The value to compare against.
380380
/// - Returns: A `BooleanExpr` that can be used in `where` clauses.
381-
func greaterThanOrEqualTo(_ other: Sendable) -> BooleanExpression
381+
func greaterThanOrEqual(_ other: Sendable) -> BooleanExpression
382382

383383
/// Creates a `BooleanExpr` that returns `true` if this expression is less
384384
/// than the given expression.
@@ -399,14 +399,14 @@ public protocol Expression: Sendable {
399399
///
400400
/// - Parameter other: The expression to compare against.
401401
/// - Returns: A `BooleanExpr` that can be used in `where` clauses.
402-
func lessThanOrEqualTo(_ other: Expression) -> BooleanExpression
402+
func lessThanOrEqual(_ other: Expression) -> BooleanExpression
403403

404404
/// Creates a `BooleanExpr` that returns `true` if this expression is less
405405
/// than or equal to the given value.
406406
///
407407
/// - Parameter other: The value to compare against.
408408
/// - Returns: A `BooleanExpr` that can be used in `where` clauses.
409-
func lessThanOrEqualTo(_ other: Sendable) -> BooleanExpression
409+
func lessThanOrEqual(_ other: Sendable) -> BooleanExpression
410410

411411
/// Creates a `BooleanExpr` that returns `true` if this expression is equal
412412
/// to the given expression.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ public struct Pipeline: @unchecked Sendable {
554554
/// // let results = try await combinedPipeline.execute()
555555
/// ```
556556
///
557-
/// - Parameter other: An array of at least one `Pipeline` whose documents will be unioned.
557+
/// - Parameter other: Another `Pipeline` whose documents will be unioned.
558558
/// - Returns: A new `Pipeline` object with this stage appended.
559559
public func union(with other: Pipeline) -> Pipeline {
560560
return Pipeline(stages: stages + [Union(other: other)], db: db)

Firestore/Swift/Tests/Integration/PipelineApiTests.swift

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -310,13 +310,12 @@ final class PipelineApiTests: FSTIntegrationTestCase {
310310
]
311311
)
312312

313-
// One special Field value is conveniently exposed as static function to help the user reference
314-
// reserved field values of __name__.
315-
// TBD
316-
// _ = db.pipeline().collection("books")
317-
// .addFields(
318-
// FieldPath.documentID()
319-
// )
313+
// One special Field value is conveniently exposed as constructor to help the user reference reserved field values of __name__.
314+
_ = db.pipeline().collection("books")
315+
.addFields([
316+
DocumentId()
317+
]
318+
)
320319
}
321320

322321
func testConstant() async throws {

Firestore/Swift/Tests/Integration/PipelineTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,7 +1956,7 @@ class PipelineIntegrationTests: FSTIntegrationTestCase {
19561956
.collection(collRef.path)
19571957
.where(
19581958
Field("rating").greaterThan(4.2) &&
1959-
Field("rating").lessThanOrEqualTo(4.5) &&
1959+
Field("rating").lessThanOrEqual(4.5) &&
19601960
Field("genre").notEqual("Science Fiction")
19611961
)
19621962
.select(["rating", "title"])
@@ -2338,7 +2338,7 @@ class PipelineIntegrationTests: FSTIntegrationTestCase {
23382338

23392339
let pipeline = db.pipeline()
23402340
.collection(collRef.path)
2341-
.aggregate([AggregateFunction("count_if", [Field("rating").greaterThanOrEqualTo(4.5)])
2341+
.aggregate([AggregateFunction("count_if", [Field("rating").greaterThanOrEqual(4.5)])
23422342
.as("countOfBest")])
23432343

23442344
let snapshot = try await pipeline.execute()

0 commit comments

Comments
 (0)