File tree Expand file tree Collapse file tree 5 files changed +9
-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 5 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -381,7 +381,7 @@ external object firebase {
381
381
382
382
open class CollectionReference : Query {
383
383
val path: String
384
- fun doc (path : String ): DocumentReference
384
+ fun doc (path : String = definedExternally ): DocumentReference
385
385
fun add (data : Any ): Promise <DocumentReference >
386
386
}
387
387
Original file line number Diff line number Diff line change @@ -364,6 +364,9 @@ actual class CollectionReference(override val android: com.google.firebase.fires
364
364
actual val path: String
365
365
get() = android.path
366
366
367
+ actual val document: DocumentReference
368
+ get() = DocumentReference (android.document())
369
+
367
370
actual fun document (documentPath : String ) = DocumentReference (android.document(documentPath))
368
371
369
372
actual suspend inline fun <reified T > add (data : T , encodeDefaults : Boolean ) =
Original file line number Diff line number Diff line change @@ -128,6 +128,7 @@ expect class DocumentReference {
128
128
129
129
expect class CollectionReference : Query {
130
130
val path: String
131
+ val document: DocumentReference
131
132
132
133
fun document (documentPath : String ): DocumentReference
133
134
suspend inline fun <reified T > add (data : T , encodeDefaults : Boolean = true): DocumentReference
Original file line number Diff line number Diff line change @@ -279,6 +279,8 @@ actual class CollectionReference(override val ios: FIRCollectionReference) : Que
279
279
actual val path: String
280
280
get() = ios.path
281
281
282
+ actual val document get() = DocumentReference (ios.documentWithAutoID())
283
+
282
284
actual fun document (documentPath : String ) = DocumentReference (ios.documentWithPath(documentPath))
283
285
284
286
actual suspend inline fun <reified T > add (data : T , encodeDefaults : Boolean ) =
Original file line number Diff line number Diff line change @@ -345,6 +345,8 @@ actual class CollectionReference(override val js: firebase.firestore.CollectionR
345
345
actual val path: String
346
346
get() = rethrow { js.path }
347
347
348
+ actual val document get() = rethrow { DocumentReference (js.doc()) }
349
+
348
350
actual fun document (documentPath : String ) = rethrow { DocumentReference (js.doc(documentPath)) }
349
351
350
352
actual suspend inline fun <reified T > add (data : T , encodeDefaults : Boolean ) =
You can’t perform that action at this time.
0 commit comments