@@ -87,8 +87,8 @@ expect open class Query {
87
87
fun snapshots (includeMetadataChanges : Boolean = false): Flow <QuerySnapshot >
88
88
suspend fun get (): QuerySnapshot
89
89
90
- internal fun where (field : String , vararg clauses : WhereClause ): Query
91
- internal fun where (path : FieldPath , vararg clauses : WhereClause ): Query
90
+ fun where (field : String , vararg clauses : WhereClause ): Query
91
+ fun where (path : FieldPath , vararg clauses : WhereClause ): Query
92
92
93
93
internal fun _orderBy (field : String , direction : Direction ): Query
94
94
internal fun _orderBy (field : FieldPath , direction : Direction ): Query
@@ -113,10 +113,12 @@ private val Any.safeValue: Any get() = when (this) {
113
113
else -> this
114
114
}
115
115
116
- fun Query.where (field : String , equalTo : Any? ) = where(field, WhereClause .EqualTo (equalTo))
117
- fun Query.where (path : FieldPath , equalTo : Any? ) = where(path, WhereClause .EqualTo (equalTo))
118
- fun Query.whereNot (field : String , notEqualTo : Any? ) = where(field, WhereClause .NotEqualTo (notEqualTo))
119
- fun Query.whereNot (path : FieldPath , notEqualTo : Any? ) = where(path, WhereClause .NotEqualTo (notEqualTo))
116
+ fun Query.where (field : String , equalTo : Any? ) = where(field, clause = WhereClause .EqualTo (equalTo))
117
+ fun Query.where (path : FieldPath , equalTo : Any? ) = where(path, clause = WhereClause .EqualTo (equalTo))
118
+ fun Query.where (field : String , clause : WhereClause ): Query = where(field, clauses = listOf (clause).toTypedArray())
119
+ fun Query.where (path : FieldPath , clause : WhereClause ): Query = where(path, clauses = listOf (clause).toTypedArray())
120
+ fun Query.whereNot (field : String , notEqualTo : Any? ) = where(field, clause = WhereClause .NotEqualTo (notEqualTo))
121
+ fun Query.whereNot (path : FieldPath , notEqualTo : Any? ) = where(path, clause = WhereClause .NotEqualTo (notEqualTo))
120
122
fun Query.where (field : String ,
121
123
lessThan : Any? = null,
122
124
greaterThan : Any? = null,
@@ -129,7 +131,7 @@ fun Query.where(field: String,
129
131
) =
130
132
where(
131
133
field,
132
- listOfNotNull(
134
+ clauses = listOfNotNull(
133
135
lessThan?.let { WhereClause .LessThan (it) },
134
136
greaterThan?.let { WhereClause .GreaterThan (it) },
135
137
lessThanOrEqualTo?.let { WhereClause .LessThanOrEqualTo (it) },
@@ -138,7 +140,7 @@ fun Query.where(field: String,
138
140
arrayContainsAny?.let { WhereClause .ArrayContainsAny (it) },
139
141
inArray?.let { WhereClause .InArray (it) },
140
142
notInArray?.let { WhereClause .NotInArray (it) }
141
- )
143
+ ).toTypedArray()
142
144
)
143
145
144
146
fun Query.where (path : FieldPath ,
@@ -153,7 +155,7 @@ fun Query.where(path: FieldPath,
153
155
) =
154
156
where(
155
157
path,
156
- listOfNotNull(
158
+ clauses = listOfNotNull(
157
159
lessThan?.let { WhereClause .LessThan (it) },
158
160
greaterThan?.let { WhereClause .GreaterThan (it) },
159
161
lessThanOrEqualTo?.let { WhereClause .LessThanOrEqualTo (it) },
@@ -162,10 +164,9 @@ fun Query.where(path: FieldPath,
162
164
arrayContainsAny?.let { WhereClause .ArrayContainsAny (it) },
163
165
inArray?.let { WhereClause .InArray (it) },
164
166
notInArray?.let { WhereClause .NotInArray (it) }
165
- )
167
+ ).toTypedArray()
166
168
)
167
169
168
-
169
170
fun Query.orderBy (field : String , direction : Direction = Direction .ASCENDING ) = _orderBy (field, direction)
170
171
fun Query.orderBy (field : FieldPath , direction : Direction = Direction .ASCENDING ) = _orderBy (field, direction)
171
172
0 commit comments