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 @@ -297,6 +297,9 @@ actual class DocumentReference(val android: com.google.firebase.firestore.Docume
297
297
actual val path: String
298
298
get() = android.path
299
299
300
+ actual val parent: CollectionReference
301
+ get() = CollectionReference (android.parent)
302
+
300
303
actual fun collection (collectionPath : String ) = CollectionReference (android.collection(collectionPath))
301
304
302
305
actual suspend inline fun <reified T > set (data : T , encodeDefaults : Boolean , merge : Boolean ) = when (merge) {
@@ -439,6 +442,9 @@ actual class CollectionReference(override val android: com.google.firebase.fires
439
442
actual val document: DocumentReference
440
443
get() = DocumentReference (android.document())
441
444
445
+ actual val parent: DocumentReference ?
446
+ get() = android.parent?.let {DocumentReference (it)}
447
+
442
448
actual fun document (documentPath : String ) = DocumentReference (android.document(documentPath))
443
449
444
450
actual suspend inline fun <reified T > add (data : T , encodeDefaults : Boolean ) =
Original file line number Diff line number Diff line change @@ -167,6 +167,7 @@ expect class DocumentReference {
167
167
val id: String
168
168
val path: String
169
169
val snapshots: Flow <DocumentSnapshot >
170
+ val parent: CollectionReference
170
171
171
172
fun collection (collectionPath : String ): CollectionReference
172
173
suspend fun get (): DocumentSnapshot
@@ -191,6 +192,7 @@ expect class DocumentReference {
191
192
expect class CollectionReference : Query {
192
193
val path: String
193
194
val document: DocumentReference
195
+ val parent: DocumentReference ?
194
196
195
197
fun document (documentPath : String ): DocumentReference
196
198
suspend inline fun <reified T > add (data : T , encodeDefaults : Boolean = true): DocumentReference
Original file line number Diff line number Diff line change @@ -218,6 +218,9 @@ actual class DocumentReference(val ios: FIRDocumentReference) {
218
218
actual val path: String
219
219
get() = ios.path
220
220
221
+ actual val parent: CollectionReference
222
+ get() = CollectionReference (ios.parent)
223
+
221
224
actual fun collection (collectionPath : String ) = CollectionReference (ios.collectionWithPath(collectionPath))
222
225
223
226
actual suspend inline fun <reified T > set (data : T , encodeDefaults : Boolean , merge : Boolean ) =
@@ -326,6 +329,8 @@ actual class CollectionReference(override val ios: FIRCollectionReference) : Que
326
329
327
330
actual val document get() = DocumentReference (ios.documentWithAutoID())
328
331
332
+ actual val parent get() = ios.parent?.let {DocumentReference (it)}
333
+
329
334
actual fun document (documentPath : String ) = DocumentReference (ios.documentWithPath(documentPath))
330
335
331
336
actual suspend inline fun <reified T > add (data : T , encodeDefaults : Boolean ) =
Original file line number Diff line number Diff line change @@ -254,6 +254,9 @@ actual class DocumentReference(val js: firebase.firestore.DocumentReference) {
254
254
actual val path: String
255
255
get() = rethrow { js.path }
256
256
257
+ actual val parent: CollectionReference
258
+ get() = rethrow { CollectionReference (js.parent) }
259
+
257
260
actual fun collection (collectionPath : String ) = rethrow { CollectionReference (js.collection(collectionPath)) }
258
261
259
262
actual suspend inline fun <reified T > set (data : T , encodeDefaults : Boolean , merge : Boolean ) =
@@ -387,6 +390,8 @@ actual class CollectionReference(override val js: firebase.firestore.CollectionR
387
390
388
391
actual val document get() = rethrow { DocumentReference (js.doc()) }
389
392
393
+ actual val parent get() = rethrow { js.parent?.let {DocumentReference (it)} }
394
+
390
395
actual fun document (documentPath : String ) = rethrow { DocumentReference (js.doc(documentPath)) }
391
396
392
397
actual suspend inline fun <reified T > add (data : T , encodeDefaults : Boolean ) =
You can’t perform that action at this time.
0 commit comments