Skip to content

Commit 5f4cc8d

Browse files
committed
PR remark
1 parent 4fbfc1d commit 5f4cc8d

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/Filter.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,19 +105,19 @@ class FilterBuilder internal constructor() {
105105
return Filter.Path(this, WhereConstraint.ArrayContainsAny(values))
106106
}
107107

108-
infix fun String.`in`(values: List<Any>): Filter.WithConstraint {
108+
infix fun String.inArray(values: List<Any>): Filter.WithConstraint {
109109
return Filter.Field(this, WhereConstraint.InArray(values))
110110
}
111111

112-
infix fun FieldPath.`in`(values: List<Any>): Filter.WithConstraint {
112+
infix fun FieldPath.inArray(values: List<Any>): Filter.WithConstraint {
113113
return Filter.Path(this, WhereConstraint.InArray(values))
114114
}
115115

116-
infix fun String.notIn(values: List<Any>): Filter.WithConstraint {
116+
infix fun String.notInArray(values: List<Any>): Filter.WithConstraint {
117117
return Filter.Field(this, WhereConstraint.NotInArray(values))
118118
}
119119

120-
infix fun FieldPath.notIn(values: List<Any>): Filter.WithConstraint {
120+
infix fun FieldPath.notInArray(values: List<Any>): Filter.WithConstraint {
121121
return Filter.Path(this, WhereConstraint.NotInArray(values))
122122
}
123123

firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ fun Query.where(path: FieldPath, lessThan: Any? = null, greaterThan: Any? = null
112112
fun Query.where(field: String, inArray: List<Any>? = null, arrayContainsAny: List<Any>? = null) = where {
113113
all(
114114
*listOfNotNull(
115-
inArray?.let { field `in` it },
115+
inArray?.let { field inArray it },
116116
arrayContainsAny?.let { field containsAny it },
117117
).toTypedArray()
118118
)
@@ -122,7 +122,7 @@ fun Query.where(field: String, inArray: List<Any>? = null, arrayContainsAny: Lis
122122
fun Query.where(path: FieldPath, inArray: List<Any>? = null, arrayContainsAny: List<Any>? = null) = where {
123123
all(
124124
*listOfNotNull(
125-
inArray?.let { path `in` it },
125+
inArray?.let { path inArray it },
126126
arrayContainsAny?.let { path containsAny it },
127127
).toTypedArray()
128128
)

firebase-firestore/src/commonTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ import dev.gitlive.firebase.apps
1010
import dev.gitlive.firebase.initialize
1111
import dev.gitlive.firebase.runBlockingTest
1212
import dev.gitlive.firebase.runTest
13-
import kotlinx.coroutines.CoroutineScope
1413
import kotlinx.coroutines.Dispatchers
1514
import kotlinx.coroutines.async
1615
import kotlinx.coroutines.delay
1716
import kotlinx.coroutines.flow.filter
1817
import kotlinx.coroutines.flow.first
19-
import kotlinx.coroutines.test.TestResult
2018
import kotlinx.coroutines.withContext
2119
import kotlinx.serialization.KSerializer
2220
import kotlinx.serialization.Serializable
@@ -702,13 +700,13 @@ class FirebaseFirestoreTest {
702700

703701
val fieldQuery = firestore
704702
.collection("testFirestoreQuerying")
705-
.where { "prop1" `in` listOf("aaa", "bbb") }
703+
.where { "prop1" inArray listOf("aaa", "bbb") }
706704

707705
fieldQuery.assertDocuments(FirestoreTest.serializer(), testOne, testTwo)
708706

709707
val pathQuery = firestore
710708
.collection("testFirestoreQuerying")
711-
.where { FieldPath(FirestoreTest::prop1.name) `in` listOf("ccc", "ddd") }
709+
.where { FieldPath(FirestoreTest::prop1.name) inArray listOf("ccc", "ddd") }
712710

713711
pathQuery.assertDocuments(FirestoreTest.serializer(), testThree)
714712
}
@@ -719,13 +717,13 @@ class FirebaseFirestoreTest {
719717

720718
val fieldQuery = firestore
721719
.collection("testFirestoreQuerying")
722-
.where { "prop1" notIn listOf("aaa", "bbb") }
720+
.where { "prop1" notInArray listOf("aaa", "bbb") }
723721

724722
fieldQuery.assertDocuments(FirestoreTest.serializer(), testThree)
725723

726724
val pathQuery = firestore
727725
.collection("testFirestoreQuerying")
728-
.where { FieldPath(FirestoreTest::prop1.name) notIn listOf("ccc", "ddd") }
726+
.where { FieldPath(FirestoreTest::prop1.name) notInArray listOf("ccc", "ddd") }
729727

730728
pathQuery.assertDocuments(FirestoreTest.serializer(), testOne, testTwo)
731729
}
@@ -737,7 +735,7 @@ class FirebaseFirestoreTest {
737735
val andQuery = firestore
738736
.collection("testFirestoreQuerying")
739737
.where {
740-
FieldPath(FirestoreTest::prop1.name) `in` listOf("aaa", "bbb") and (FieldPath(FirestoreTest::count.name) equalTo 1)
738+
FieldPath(FirestoreTest::prop1.name) inArray listOf("aaa", "bbb") and (FieldPath(FirestoreTest::count.name) equalTo 1)
741739
}
742740
andQuery.assertDocuments(FirestoreTest.serializer(), testOne)
743741

0 commit comments

Comments
 (0)