File tree Expand file tree Collapse file tree 6 files changed +21
-1
lines changed
firebase-common/src/jsMain/kotlin/dev/gitlive/firebase
androidMain/kotlin/dev/gitlive/firebase/firestore
commonMain/kotlin/dev/gitlive/firebase/firestore
iosMain/kotlin/dev/gitlive/firebase/firestore
jsMain/kotlin/dev/gitlive/firebase/firestore Expand file tree Collapse file tree 6 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ subprojects {
197
197
dependencies {
198
198
" commonMainImplementation" (" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2" )
199
199
" androidMainImplementation" (" org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.5.2" )
200
- " androidMainImplementation" (platform(" com.google.firebase:firebase-bom:28.4 .1" ))
200
+ " androidMainImplementation" (platform(" com.google.firebase:firebase-bom:29.0 .1" ))
201
201
" commonTestImplementation" (kotlin(" test-common" ))
202
202
" commonTestImplementation" (kotlin(" test-annotations-common" ))
203
203
" commonTestImplementation" (" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2" )
Original file line number Diff line number Diff line change @@ -383,6 +383,7 @@ external object firebase {
383
383
384
384
open class CollectionReference : Query {
385
385
val path: String
386
+ val parent: DocumentReference ?
386
387
fun doc (path : String = definedExternally): DocumentReference
387
388
fun add (data : Any ): Promise <DocumentReference >
388
389
}
@@ -419,6 +420,7 @@ external object firebase {
419
420
open class DocumentReference {
420
421
val id: String
421
422
val path: String
423
+ val parent: CollectionReference
422
424
423
425
fun collection (path : String ): CollectionReference
424
426
fun get (options : Any? = definedExternally): Promise <DocumentSnapshot >
Original file line number Diff line number Diff line change @@ -227,6 +227,9 @@ actual class DocumentReference(val android: com.google.firebase.firestore.Docume
227
227
actual val path: String
228
228
get() = android.path
229
229
230
+ actual val parent: CollectionReference
231
+ get() = CollectionReference (android.parent)
232
+
230
233
actual fun collection (collectionPath : String ) = CollectionReference (android.collection(collectionPath))
231
234
232
235
actual suspend inline fun <reified T > set (data : T , encodeDefaults : Boolean , merge : Boolean ) = when (merge) {
@@ -367,6 +370,9 @@ actual class CollectionReference(override val android: com.google.firebase.fires
367
370
actual val document: DocumentReference
368
371
get() = DocumentReference (android.document())
369
372
373
+ actual val parent: DocumentReference ?
374
+ get() = android.parent?.let {DocumentReference (it)}
375
+
370
376
actual fun document (documentPath : String ) = DocumentReference (android.document(documentPath))
371
377
372
378
actual suspend inline fun <reified T > add (data : T , encodeDefaults : Boolean ) =
Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ expect class DocumentReference {
105
105
val id: String
106
106
val path: String
107
107
val snapshots: Flow <DocumentSnapshot >
108
+ val parent: CollectionReference
108
109
109
110
fun collection (collectionPath : String ): CollectionReference
110
111
suspend fun get (): DocumentSnapshot
@@ -129,6 +130,7 @@ expect class DocumentReference {
129
130
expect class CollectionReference : Query {
130
131
val path: String
131
132
val document: DocumentReference
133
+ val parent: DocumentReference ?
132
134
133
135
fun document (documentPath : String ): DocumentReference
134
136
suspend inline fun <reified T > add (data : T , encodeDefaults : Boolean = true): DocumentReference
Original file line number Diff line number Diff line change @@ -174,6 +174,9 @@ actual class DocumentReference(val ios: FIRDocumentReference) {
174
174
actual val path: String
175
175
get() = ios.path
176
176
177
+ actual val parent: CollectionReference
178
+ get() = CollectionReference (ios.parent)
179
+
177
180
actual fun collection (collectionPath : String ) = CollectionReference (ios.collectionWithPath(collectionPath))
178
181
179
182
actual suspend inline fun <reified T > set (data : T , encodeDefaults : Boolean , merge : Boolean ) =
@@ -282,6 +285,8 @@ actual class CollectionReference(override val ios: FIRCollectionReference) : Que
282
285
283
286
actual val document get() = DocumentReference (ios.documentWithAutoID())
284
287
288
+ actual val parent get() = ios.parent?.let {DocumentReference (it)}
289
+
285
290
actual fun document (documentPath : String ) = DocumentReference (ios.documentWithPath(documentPath))
286
291
287
292
actual suspend inline fun <reified T > add (data : T , encodeDefaults : Boolean ) =
Original file line number Diff line number Diff line change @@ -214,6 +214,9 @@ actual class DocumentReference(val js: firebase.firestore.DocumentReference) {
214
214
actual val path: String
215
215
get() = rethrow { js.path }
216
216
217
+ actual val parent: CollectionReference
218
+ get() = rethrow { CollectionReference (js.parent) }
219
+
217
220
actual fun collection (collectionPath : String ) = rethrow { CollectionReference (js.collection(collectionPath)) }
218
221
219
222
actual suspend inline fun <reified T > set (data : T , encodeDefaults : Boolean , merge : Boolean ) =
@@ -347,6 +350,8 @@ actual class CollectionReference(override val js: firebase.firestore.CollectionR
347
350
348
351
actual val document get() = rethrow { DocumentReference (js.doc()) }
349
352
353
+ actual val parent get() = rethrow { js.parent?.let {DocumentReference (it)} }
354
+
350
355
actual fun document (documentPath : String ) = rethrow { DocumentReference (js.doc(documentPath)) }
351
356
352
357
actual suspend inline fun <reified T > add (data : T , encodeDefaults : Boolean ) =
You can’t perform that action at this time.
0 commit comments