@@ -87,8 +87,8 @@ expect open class Query {
8787 fun snapshots (includeMetadataChanges : Boolean = false): Flow <QuerySnapshot >
8888 suspend fun get (): QuerySnapshot
8989
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
9292
9393 internal fun _orderBy (field : String , direction : Direction ): Query
9494 internal fun _orderBy (field : FieldPath , direction : Direction ): Query
@@ -113,10 +113,12 @@ private val Any.safeValue: Any get() = when (this) {
113113 else -> this
114114}
115115
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))
120122fun Query.where (field : String ,
121123 lessThan : Any? = null,
122124 greaterThan : Any? = null,
@@ -129,7 +131,7 @@ fun Query.where(field: String,
129131) =
130132 where(
131133 field,
132- listOfNotNull(
134+ clauses = listOfNotNull(
133135 lessThan?.let { WhereClause .LessThan (it) },
134136 greaterThan?.let { WhereClause .GreaterThan (it) },
135137 lessThanOrEqualTo?.let { WhereClause .LessThanOrEqualTo (it) },
@@ -138,7 +140,7 @@ fun Query.where(field: String,
138140 arrayContainsAny?.let { WhereClause .ArrayContainsAny (it) },
139141 inArray?.let { WhereClause .InArray (it) },
140142 notInArray?.let { WhereClause .NotInArray (it) }
141- )
143+ ).toTypedArray()
142144 )
143145
144146fun Query.where (path : FieldPath ,
@@ -153,7 +155,7 @@ fun Query.where(path: FieldPath,
153155) =
154156 where(
155157 path,
156- listOfNotNull(
158+ clauses = listOfNotNull(
157159 lessThan?.let { WhereClause .LessThan (it) },
158160 greaterThan?.let { WhereClause .GreaterThan (it) },
159161 lessThanOrEqualTo?.let { WhereClause .LessThanOrEqualTo (it) },
@@ -162,10 +164,9 @@ fun Query.where(path: FieldPath,
162164 arrayContainsAny?.let { WhereClause .ArrayContainsAny (it) },
163165 inArray?.let { WhereClause .InArray (it) },
164166 notInArray?.let { WhereClause .NotInArray (it) }
165- )
167+ ).toTypedArray()
166168 )
167169
168-
169170fun Query.orderBy (field : String , direction : Direction = Direction .ASCENDING ) = _orderBy (field, direction)
170171fun Query.orderBy (field : FieldPath , direction : Direction = Direction .ASCENDING ) = _orderBy (field, direction)
171172
0 commit comments