Skip to content

Commit 7aed083

Browse files
committed
remove null / nan related operations
1 parent 3475b66 commit 7aed083

File tree

3 files changed

+0
-65
lines changed

3 files changed

+0
-65
lines changed

Firestore/Swift/Source/ExpressionImplementation.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -615,14 +615,6 @@ public extension Expression {
615615

616616
// --- Added Type Check Operations ---
617617

618-
func isNan() -> BooleanExpression {
619-
return BooleanExpression(functionName: "is_nan", args: [self])
620-
}
621-
622-
func isNil() -> BooleanExpression {
623-
return BooleanExpression(functionName: "is_null", args: [self])
624-
}
625-
626618
func exists() -> BooleanExpression {
627619
return BooleanExpression(functionName: "exists", args: [self])
628620
}
@@ -635,14 +627,6 @@ public extension Expression {
635627
return BooleanExpression(functionName: "is_absent", args: [self])
636628
}
637629

638-
func isNotNil() -> BooleanExpression {
639-
return BooleanExpression(functionName: "is_not_null", args: [self])
640-
}
641-
642-
func isNotNan() -> BooleanExpression {
643-
return BooleanExpression(functionName: "is_not_nan", args: [self])
644-
}
645-
646630
// --- Added String Operations ---
647631

648632
func join(delimiter: String) -> FunctionExpression {

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

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -617,26 +617,6 @@ public protocol Expression: Sendable {
617617
/// - Returns: A `BooleanExpression` that can be used in `where` clauses.
618618
func notEqualAny(_ arrayExpression: Expression) -> BooleanExpression
619619

620-
/// Creates an expression that checks if this expression evaluates to "NaN" (Not a Number).
621-
///
622-
/// ```swift
623-
/// // Check if the result of a calculation is NaN
624-
/// Field("value").divide(0).isNan()
625-
/// ```
626-
///
627-
/// - Returns: A new `BooleanExpression` representing the "isNaN" check.
628-
func isNan() -> BooleanExpression
629-
630-
/// Creates an expression that checks if this expression evaluates to "Nil".
631-
///
632-
/// ```swift
633-
/// // Check if the "optionalField" is null
634-
/// Field("optionalField").isNil()
635-
/// ```
636-
///
637-
/// - Returns: A new `BooleanExpression` representing the "isNil" check.
638-
func isNil() -> BooleanExpression
639-
640620
/// Creates an expression that checks if a field exists in the document.
641621
///
642622
/// ```swift
@@ -668,27 +648,6 @@ public protocol Expression: Sendable {
668648
/// - Returns: A new `BooleanExpression` representing the "isAbsent" check.
669649
func isAbsent() -> BooleanExpression
670650

671-
/// Creates an expression that checks if the result of this expression is not null.
672-
///
673-
/// ```swift
674-
/// // Check if the value of the "name" field is not null
675-
/// Field("name").isNotNil()
676-
/// ```
677-
///
678-
/// - Returns: A new `BooleanExpression` representing the "isNotNil" check.
679-
func isNotNil() -> BooleanExpression
680-
681-
/// Creates an expression that checks if the results of this expression is NOT "NaN" (Not a
682-
/// Number).
683-
///
684-
/// ```swift
685-
/// // Check if the result of a calculation is NOT NaN
686-
/// Field("value").divide(Field("count")).isNotNan() // Assuming count might be 0
687-
/// ```
688-
///
689-
/// - Returns: A new `BooleanExpr` representing the "isNotNaN" check.
690-
func isNotNan() -> BooleanExpression
691-
692651
// MARK: String Operations
693652

694653
/// Creates an expression that joins the elements of an array of strings with a given separator.

Firestore/Swift/Tests/Integration/PipelineTests.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2507,11 +2507,7 @@ class PipelineIntegrationTests: FSTIntegrationTestCase {
25072507
.limit(1)
25082508
.select(
25092509
[
2510-
Field("rating").isNil().as("ratingIsNull"),
2511-
Field("rating").isNan().as("ratingIsNaN"),
25122510
Field("foo").isAbsent().as("isAbsent"),
2513-
Field("title").isNotNil().as("titleIsNotNull"),
2514-
Field("cost").isNotNan().as("costIsNotNan"),
25152511
Field("fooBarBaz").exists().as("fooBarBazExists"),
25162512
Field("title").exists().as("titleExists"),
25172513
]
@@ -2522,11 +2518,7 @@ class PipelineIntegrationTests: FSTIntegrationTestCase {
25222518

25232519
if let resultDoc = snapshot.results.first {
25242520
let expectedResults: [String: Sendable?] = [
2525-
"ratingIsNull": false,
2526-
"ratingIsNaN": false,
25272521
"isAbsent": true,
2528-
"titleIsNotNull": true,
2529-
"costIsNotNan": false,
25302522
"fooBarBazExists": false,
25312523
"titleExists": true,
25322524
]

0 commit comments

Comments
 (0)