From b7df5b19b2c5544a782c2e56228eea72ee7714fd Mon Sep 17 00:00:00 2001 From: Shabbirjodhpur <62835725+Shabbirjodhpur@users.noreply.github.com> Date: Tue, 4 Apr 2023 12:40:38 +0530 Subject: [PATCH 1/3] Update get_document.js We get the snapshot of data using 'getDoc()' and get result 'docSnap' And then we perform check on this 'docSnap' in the if else block So in the else block the comment should ne docSnap.data() will ne undefined --- snippets/firestore-next/test-firestore/get_document.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/firestore-next/test-firestore/get_document.js b/snippets/firestore-next/test-firestore/get_document.js index 4cfbaaf6..98d54402 100644 --- a/snippets/firestore-next/test-firestore/get_document.js +++ b/snippets/firestore-next/test-firestore/get_document.js @@ -13,7 +13,7 @@ const docSnap = await getDoc(docRef); if (docSnap.exists()) { console.log("Document data:", docSnap.data()); } else { - // doc.data() will be undefined in this case + // docSnap.data() will be undefined in this case console.log("No such document!"); } -// [END get_document_modular] \ No newline at end of file +// [END get_document_modular] From 9a5e6ddd3e8df520f02ba78bd150aae2107bd804 Mon Sep 17 00:00:00 2001 From: shabbir_j Date: Tue, 4 Apr 2023 21:15:00 +0530 Subject: [PATCH 2/3] changed comment from test.firestore --- firestore-next/test.firestore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firestore-next/test.firestore.js b/firestore-next/test.firestore.js index 2469b736..a430064f 100644 --- a/firestore-next/test.firestore.js +++ b/firestore-next/test.firestore.js @@ -583,7 +583,7 @@ describe("firestore", () => { if (docSnap.exists()) { console.log("Document data:", docSnap.data()); } else { - // doc.data() will be undefined in this case + // docSnap.data() will be undefined in this case console.log("No such document!"); } // [END get_document] From ca247482cfce2fd4fb52d869f8095729656d773f Mon Sep 17 00:00:00 2001 From: Shabbirjodhpur <62835725+Shabbirjodhpur@users.noreply.github.com> Date: Tue, 4 Apr 2023 16:02:49 +0000 Subject: [PATCH 3/3] made changes adn ran npm run snippets --- snippets/firestore-next/test-firestore/get_document.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/firestore-next/test-firestore/get_document.js b/snippets/firestore-next/test-firestore/get_document.js index 98d54402..1653b61a 100644 --- a/snippets/firestore-next/test-firestore/get_document.js +++ b/snippets/firestore-next/test-firestore/get_document.js @@ -16,4 +16,4 @@ if (docSnap.exists()) { // docSnap.data() will be undefined in this case console.log("No such document!"); } -// [END get_document_modular] +// [END get_document_modular] \ No newline at end of file