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 @@ -196,7 +196,7 @@ subprojects {
196
196
dependencies {
197
197
" commonMainImplementation" (" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2" )
198
198
" androidMainImplementation" (" org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.5.2" )
199
- " androidMainImplementation" (platform(" com.google.firebase:firebase-bom:29.0.0 " ))
199
+ " androidMainImplementation" (platform(" com.google.firebase:firebase-bom:29.0.1 " ))
200
200
" commonTestImplementation" (kotlin(" test-common" ))
201
201
" commonTestImplementation" (kotlin(" test-annotations-common" ))
202
202
" commonTestImplementation" (" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2" )
Original file line number Diff line number Diff line change @@ -384,6 +384,7 @@ external object firebase {
384
384
385
385
open class CollectionReference : Query {
386
386
val path: String
387
+ val parent: DocumentReference ?
387
388
fun doc (path : String = definedExternally): DocumentReference
388
389
fun add (data : Any ): Promise <DocumentReference >
389
390
}
@@ -420,6 +421,7 @@ external object firebase {
420
421
open class DocumentReference {
421
422
val id: String
422
423
val path: String
424
+ val parent: CollectionReference
423
425
424
426
fun collection (path : String ): CollectionReference
425
427
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) {
@@ -369,6 +372,9 @@ actual class CollectionReference(override val android: com.google.firebase.fires
369
372
actual val document: DocumentReference
370
373
get() = DocumentReference (android.document())
371
374
375
+ actual val parent: DocumentReference ?
376
+ get() = android.parent?.let {DocumentReference (it)}
377
+
372
378
actual fun document (documentPath : String ) = DocumentReference (android.document(documentPath))
373
379
374
380
actual suspend inline fun <reified T > add (data : T , encodeDefaults : Boolean ) =
Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ expect class DocumentReference {
109
109
val id: String
110
110
val path: String
111
111
val snapshots: Flow <DocumentSnapshot >
112
+ val parent: CollectionReference
112
113
113
114
fun collection (collectionPath : String ): CollectionReference
114
115
suspend fun get (): DocumentSnapshot
@@ -133,6 +134,7 @@ expect class DocumentReference {
133
134
expect class CollectionReference : Query {
134
135
val path: String
135
136
val document: DocumentReference
137
+ val parent: DocumentReference ?
136
138
137
139
fun document (documentPath : String ): DocumentReference
138
140
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 ) =
@@ -283,6 +286,8 @@ actual class CollectionReference(override val ios: FIRCollectionReference) : Que
283
286
284
287
actual val document get() = DocumentReference (ios.documentWithAutoID())
285
288
289
+ actual val parent get() = ios.parent?.let {DocumentReference (it)}
290
+
286
291
actual fun document (documentPath : String ) = DocumentReference (ios.documentWithPath(documentPath))
287
292
288
293
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 ) =
@@ -351,6 +354,8 @@ actual class CollectionReference(override val js: firebase.firestore.CollectionR
351
354
352
355
actual val document get() = rethrow { DocumentReference (js.doc()) }
353
356
357
+ actual val parent get() = rethrow { js.parent?.let {DocumentReference (it)} }
358
+
354
359
actual fun document (documentPath : String ) = rethrow { DocumentReference (js.doc(documentPath)) }
355
360
356
361
actual suspend inline fun <reified T > add (data : T , encodeDefaults : Boolean ) =
You can’t perform that action at this time.
0 commit comments