This repository was archived by the owner on Apr 4, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 1111
1212### Fixes
1313- [ #563 ] ( https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/563 ) Initialization problem on 5.0.2 on iOS
14+ - [ #559 ] ( https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/559 ) Firestore nested collections
1415
1516
1617## 5.0.2 (2017, December 1)
Original file line number Diff line number Diff line change @@ -141,16 +141,19 @@ export class ItemsComponent implements OnInit {
141141 }
142142
143143 public firestoreGetNested ( ) : void {
144- const streetsColRef : firestore . CollectionReference =
144+ const mainStreetInSFDocRef : firestore . DocumentReference =
145145 firebase . firestore ( )
146146 . collection ( "cities" )
147147 . doc ( "SF" )
148- . collection ( "streets" ) ;
148+ . collection ( "streets" )
149+ . doc ( "QZNrg22tkN8W71YC3qCb" ) ; // id of 'main st.'
149150
150- streetsColRef . get ( ) . then ( ( querySnapshot : firestore . QuerySnapshot ) => {
151- querySnapshot . forEach ( doc => {
152- console . log ( `${ doc . id } => ${ JSON . stringify ( doc . data ( ) ) } ` ) ;
153- } ) ;
151+ mainStreetInSFDocRef . get ( ) . then ( ( doc : firestore . DocumentSnapshot ) => {
152+ if ( doc . exists ) {
153+ console . log ( "Document data:" , JSON . stringify ( doc . data ( ) ) ) ;
154+ } else {
155+ console . log ( "No such document!" ) ;
156+ }
154157 } ) . catch ( function ( error ) {
155158 console . log ( "Error getting document:" , error ) ;
156159 } ) ;
Original file line number Diff line number Diff line change @@ -2197,8 +2197,6 @@ firebase.firestore.collection = (collectionPath: string): firestore.CollectionRe
21972197 return null ;
21982198 }
21992199
2200- console . log ( ">> collection, collectionPath " + collectionPath ) ;
2201-
22022200 const db = com . google . firebase . firestore . FirebaseFirestore . getInstance ( ) ;
22032201 const collectionRef : com . google . firebase . firestore . CollectionReference = db . collection ( collectionPath ) ;
22042202
You can’t perform that action at this time.
0 commit comments