@@ -14,8 +14,8 @@ Firebase as a backend for <a href="https://www.jetbrains.com/lp/compose-multipla
14
14
15
15
The following libraries are available for the various Firebase products.
16
16
17
- | Service or Product | Gradle Dependency | API Coverage |
18
- | ---------------------------------------------------------------------------------| :-----------------------------------------------------------------------------------------------------------------------------| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
17
+ | Service or Product | Gradle Dependency | API Coverage |
18
+ | ---------------------------------------------------------------------------------| :------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
19
19
| [ Authentication] ( https://firebase.google.com/docs/auth ) | [ ` dev.gitlive:firebase-auth:1.10.4 ` ] ( https://search.maven.org/artifact/dev.gitlive/firebase-auth/1.10.4/pom ) | [ ![ 80%] ( https://img.shields.io/badge/-80%25-green?style=flat-square )] ( /firebase-auth/src/commonMain/kotlin/dev/gitlive/firebase/auth/auth.kt ) |
20
20
| [ Realtime Database] ( https://firebase.google.com/docs/database ) | [ ` dev.gitlive:firebase-database:1.10.4 ` ] ( https://search.maven.org/artifact/dev.gitlive/firebase-database/1.10.4/pom ) | [ ![ 70%] ( https://img.shields.io/badge/-70%25-orange?style=flat-square )] ( /firebase-database/src/commonMain/kotlin/dev/gitlive/firebase/database/database.kt ) |
21
21
| [ Cloud Firestore] ( https://firebase.google.com/docs/firestore ) | [ ` dev.gitlive:firebase-firestore:1.10.4 ` ] ( https://search.maven.org/artifact/dev.gitlive/firebase-firestore/1.10.4/pom ) | [ ![ 60%] ( https://img.shields.io/badge/-60%25-orange?style=flat-square )] ( /firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt ) |
@@ -178,18 +178,36 @@ user.updateProfile(profileUpdates)
178
178
user.updateProfile(displayName = " state" , photoURL = " CA" )
179
179
```
180
180
181
- <h3 ><a href =" https://kotlinlang.org/docs/reference/functions.html#named-arguments " >Named arguments</a ></h3 >
182
181
183
- To improve readability functions such as the Cloud Firestore query operators use named arguments:
182
+
183
+ <h3 ><a href =" https://kotlinlang.org/docs/functions.html#infix-notation " >Infix notation</a ></h3 >
184
+
185
+ To improve readability and reduce boilerplate for functions such as the Cloud Firestore query operators are built with infix notation:
184
186
185
187
``` kotlin
186
188
citiesRef.whereEqualTo(" state" , " CA" )
187
189
citiesRef.whereArrayContains(" regions" , " west_coast" )
190
+ citiesRef.where(Filter .and (
191
+ Filter .equalTo(" state" , " CA" ),
192
+ Filter .or (
193
+ Filter .equalTo(" capital" , true ),
194
+ Filter .greaterThanOrEqualTo(" population" , 1000000 )
195
+ )
196
+ ))
188
197
189
198
// ...becomes...
190
199
191
- citiesRef.where(" state" , equalTo = " CA" )
192
- citiesRef.where(" regions" , arrayContains = " west_coast" )
200
+ citiesRef.where { " state" equalTo " CA" }
201
+ citiesRef.where { " regions" contains " west_coast" }
202
+ citiesRef.where {
203
+ all(
204
+ " state" equalTo " CA" ,
205
+ any(
206
+ " capital" equalTo true ,
207
+ " population" greaterThanOrEqualTo 1000000
208
+ )
209
+ )
210
+ }
193
211
```
194
212
195
213
<h3 ><a href =" https://kotlinlang.org/docs/reference/operator-overloading.html " >Operator overloading</a ></h3 >
0 commit comments