From 9abc050b9b997bdabced82278180598b6737eca6 Mon Sep 17 00:00:00 2001 From: Dharmaraj <63334359+DharmarajX24@users.noreply.github.com> Date: Fri, 10 Jun 2022 01:00:43 +0530 Subject: [PATCH 1/3] fixed invalid document reference error --- .../fs_collection_group_query_data_setup.js | 86 +++++++++---------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/snippets/firestore-next/test-firestore/fs_collection_group_query_data_setup.js b/snippets/firestore-next/test-firestore/fs_collection_group_query_data_setup.js index f4f62178..7712e88f 100644 --- a/snippets/firestore-next/test-firestore/fs_collection_group_query_data_setup.js +++ b/snippets/firestore-next/test-firestore/fs_collection_group_query_data_setup.js @@ -5,50 +5,50 @@ // 'npm run snippets'. // [START fs_collection_group_query_data_setup_modular] -import { collection, doc, setDoc } from "firebase/firestore"; +import { collection, doc, addDoc } from "firebase/firestore"; -const citiesRef = collection(db, 'cities'); +const citiesRef = collection(db, "cities"); await Promise.all([ - setDoc(doc(citiesRef, 'SF', 'landmarks'), { - name: 'Golden Gate Bridge', - type: 'bridge' - }), - setDoc(doc(citiesRef, 'SF', 'landmarks'), { - name: 'Legion of Honor', - type: 'museum' - }), - setDoc(doc(citiesRef, 'LA', 'landmarks'), { - name: 'Griffith Park', - type: 'park' - }), - setDoc(doc(citiesRef, 'LA', 'landmarks'), { - name: 'The Getty', - type: 'museum' - }), - setDoc(doc(citiesRef, 'DC', 'landmarks'), { - name: 'Lincoln Memorial', - type: 'memorial' - }), - setDoc(doc(citiesRef, 'DC', 'landmarks'), { - name: 'National Air and Space Museum', - type: 'museum' - }), - setDoc(doc(citiesRef, 'TOK', 'landmarks'), { - name: 'Ueno Park', - type: 'park' - }), - setDoc(doc(citiesRef, 'TOK', 'landmarks'), { - name: 'National Museum of Nature and Science', - type: 'museum' - }), - setDoc(doc(citiesRef, 'BJ', 'landmarks'), { - name: 'Jingshan Park', - type: 'park' - }), - setDoc(doc(citiesRef, 'BJ', 'landmarks'), { - name: 'Beijing Ancient Observatory', - type: 'museum' - }) + addDoc(doc(citiesRef, "SF", "landmarks"), { + name: "Golden Gate Bridge", + type: "bridge", + }), + addDoc(doc(citiesRef, "SF", "landmarks"), { + name: "Legion of Honor", + type: "museum", + }), + addDoc(doc(citiesRef, "LA", "landmarks"), { + name: "Griffith Park", + type: "park", + }), + addDoc(doc(citiesRef, "LA", "landmarks"), { + name: "The Getty", + type: "museum", + }), + addDoc(doc(citiesRef, "DC", "landmarks"), { + name: "Lincoln Memorial", + type: "memorial", + }), + addDoc(doc(citiesRef, "DC", "landmarks"), { + name: "National Air and Space Museum", + type: "museum", + }), + addDoc(doc(citiesRef, "TOK", "landmarks"), { + name: "Ueno Park", + type: "park", + }), + addDoc(doc(citiesRef, "TOK", "landmarks"), { + name: "National Museum of Nature and Science", + type: "museum", + }), + addDoc(doc(citiesRef, "BJ", "landmarks"), { + name: "Jingshan Park", + type: "park", + }), + addDoc(doc(citiesRef, "BJ", "landmarks"), { + name: "Beijing Ancient Observatory", + type: "museum", + }), ]); -// [END fs_collection_group_query_data_setup_modular] \ No newline at end of file +// [END fs_collection_group_query_data_setup_modular] From c3d212fb358b542a336d1a382be70e82d8922218 Mon Sep 17 00:00:00 2001 From: Dharmaraj <63334359+DharmarajX24@users.noreply.github.com> Date: Fri, 10 Jun 2022 01:20:30 +0530 Subject: [PATCH 2/3] fixed quotes --- .../fs_collection_group_query_data_setup.js | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/snippets/firestore-next/test-firestore/fs_collection_group_query_data_setup.js b/snippets/firestore-next/test-firestore/fs_collection_group_query_data_setup.js index 7712e88f..996ccb22 100644 --- a/snippets/firestore-next/test-firestore/fs_collection_group_query_data_setup.js +++ b/snippets/firestore-next/test-firestore/fs_collection_group_query_data_setup.js @@ -7,48 +7,48 @@ // [START fs_collection_group_query_data_setup_modular] import { collection, doc, addDoc } from "firebase/firestore"; -const citiesRef = collection(db, "cities"); +const citiesRef = collection(db, 'cities'); await Promise.all([ - addDoc(doc(citiesRef, "SF", "landmarks"), { - name: "Golden Gate Bridge", - type: "bridge", + addDoc(doc(citiesRef, 'SF', 'landmarks'), { + name: 'Golden Gate Bridge', + type: 'bridge', }), - addDoc(doc(citiesRef, "SF", "landmarks"), { - name: "Legion of Honor", - type: "museum", + addDoc(doc(citiesRef, 'SF', 'landmarks'), { + name: 'Legion of Honor', + type: 'museum', }), - addDoc(doc(citiesRef, "LA", "landmarks"), { - name: "Griffith Park", - type: "park", + addDoc(doc(citiesRef, 'LA', 'landmarks'), { + name: 'Griffith Park', + type: 'park', }), - addDoc(doc(citiesRef, "LA", "landmarks"), { - name: "The Getty", - type: "museum", + addDoc(doc(citiesRef, 'LA', 'landmarks'), { + name: 'The Getty', + type: 'museum', }), - addDoc(doc(citiesRef, "DC", "landmarks"), { - name: "Lincoln Memorial", - type: "memorial", + addDoc(doc(citiesRef, 'DC', 'landmarks'), { + name: 'Lincoln Memorial', + type: 'memorial', }), - addDoc(doc(citiesRef, "DC", "landmarks"), { - name: "National Air and Space Museum", - type: "museum", + addDoc(doc(citiesRef, 'DC', 'landmarks'), { + name: 'National Air and Space Museum', + type: 'museum', }), - addDoc(doc(citiesRef, "TOK", "landmarks"), { - name: "Ueno Park", - type: "park", + addDoc(doc(citiesRef, 'TOK', 'landmarks'), { + name: 'Ueno Park', + type: 'park', }), - addDoc(doc(citiesRef, "TOK", "landmarks"), { - name: "National Museum of Nature and Science", - type: "museum", + addDoc(doc(citiesRef, 'TOK', 'landmarks'), { + name: 'National Museum of Nature and Science', + type: 'museum', }), - addDoc(doc(citiesRef, "BJ", "landmarks"), { - name: "Jingshan Park", - type: "park", + addDoc(doc(citiesRef, 'BJ', 'landmarks'), { + name: 'Jingshan Park', + type: 'park', }), - addDoc(doc(citiesRef, "BJ", "landmarks"), { - name: "Beijing Ancient Observatory", - type: "museum", + addDoc(doc(citiesRef, 'BJ', 'landmarks'), { + name: 'Beijing Ancient Observatory', + type: 'museum', }), ]); // [END fs_collection_group_query_data_setup_modular] From 06ead4012b2a417f7176a00a64f012a57deb350d Mon Sep 17 00:00:00 2001 From: Dharmaraj <63334359+DharmarajX24@users.noreply.github.com> Date: Thu, 9 Jun 2022 19:57:09 +0000 Subject: [PATCH 3/3] ran snippets command --- .../fs_collection_group_query_data_setup.js | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/snippets/firestore-next/test-firestore/fs_collection_group_query_data_setup.js b/snippets/firestore-next/test-firestore/fs_collection_group_query_data_setup.js index 996ccb22..f4f62178 100644 --- a/snippets/firestore-next/test-firestore/fs_collection_group_query_data_setup.js +++ b/snippets/firestore-next/test-firestore/fs_collection_group_query_data_setup.js @@ -5,50 +5,50 @@ // 'npm run snippets'. // [START fs_collection_group_query_data_setup_modular] -import { collection, doc, addDoc } from "firebase/firestore"; +import { collection, doc, setDoc } from "firebase/firestore"; const citiesRef = collection(db, 'cities'); await Promise.all([ - addDoc(doc(citiesRef, 'SF', 'landmarks'), { + setDoc(doc(citiesRef, 'SF', 'landmarks'), { name: 'Golden Gate Bridge', - type: 'bridge', + type: 'bridge' }), - addDoc(doc(citiesRef, 'SF', 'landmarks'), { + setDoc(doc(citiesRef, 'SF', 'landmarks'), { name: 'Legion of Honor', - type: 'museum', + type: 'museum' }), - addDoc(doc(citiesRef, 'LA', 'landmarks'), { + setDoc(doc(citiesRef, 'LA', 'landmarks'), { name: 'Griffith Park', - type: 'park', + type: 'park' }), - addDoc(doc(citiesRef, 'LA', 'landmarks'), { + setDoc(doc(citiesRef, 'LA', 'landmarks'), { name: 'The Getty', - type: 'museum', + type: 'museum' }), - addDoc(doc(citiesRef, 'DC', 'landmarks'), { + setDoc(doc(citiesRef, 'DC', 'landmarks'), { name: 'Lincoln Memorial', - type: 'memorial', + type: 'memorial' }), - addDoc(doc(citiesRef, 'DC', 'landmarks'), { + setDoc(doc(citiesRef, 'DC', 'landmarks'), { name: 'National Air and Space Museum', - type: 'museum', + type: 'museum' }), - addDoc(doc(citiesRef, 'TOK', 'landmarks'), { + setDoc(doc(citiesRef, 'TOK', 'landmarks'), { name: 'Ueno Park', - type: 'park', + type: 'park' }), - addDoc(doc(citiesRef, 'TOK', 'landmarks'), { + setDoc(doc(citiesRef, 'TOK', 'landmarks'), { name: 'National Museum of Nature and Science', - type: 'museum', + type: 'museum' }), - addDoc(doc(citiesRef, 'BJ', 'landmarks'), { + setDoc(doc(citiesRef, 'BJ', 'landmarks'), { name: 'Jingshan Park', - type: 'park', + type: 'park' }), - addDoc(doc(citiesRef, 'BJ', 'landmarks'), { + setDoc(doc(citiesRef, 'BJ', 'landmarks'), { name: 'Beijing Ancient Observatory', - type: 'museum', - }), + type: 'museum' + }) ]); -// [END fs_collection_group_query_data_setup_modular] +// [END fs_collection_group_query_data_setup_modular] \ No newline at end of file