@@ -16,38 +16,25 @@ firebase.initializeApp({
1616
1717const db = firebase . firestore ( ) ;
1818
19- const collections = [ ] ;
20-
21- const coursePayload = {
22- db : db ,
23- collection : vegetables . collection ,
24- collectionPath : 'vegetables' ,
25- // nestedCollectionPath: 'lessons',
26- // nestedCollection: vegetables.nestedCollection,
27- // nestedCollectionParentIndex: 0,
28- // targetObj: {
29- // key: 'url',
30- // value: 'serverless-angular'
31- // }
32- } ;
3319
3420const categoriesPayload = {
3521 db : db ,
3622 collection : categories . collection ,
3723 collectionPath : 'categories' ,
24+ nestedCollectionPath : [ 'bread' , 'vegetables' ] ,
25+ nestedCollection : categories . nestedCollection ,
26+ nestedCollectionParentIndex : [ 0 , 4 ]
3827} ;
3928
40- const breadPayload = {
41- db : db ,
42- collection : bread . collection ,
43- collectionPath : 'bread' ,
44- } ;
29+
30+ firestore . populate ( categoriesPayload ) ;
31+
4532
4633// UPLOAD TO FIRESTORE
47- collections . push ( coursePayload , categoriesPayload , breadPayload ) ;
48- collections . forEach ( ( payloadCollection ) => {
49- firestore . populate ( payloadCollection ) ;
50- } ) ;
34+ // collections.push(coursePayload, categoriesPayload, breadPayload);
35+ // collections.forEach((payloadCollection) => {
36+ // firestore.populate(payloadCollection);
37+ // });
5138
5239
5340
0 commit comments