Skip to content

Commit

Permalink
Update get_document.js (#335)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Shabbirjodhpur committed Apr 4, 2023
1 parent 486e5c6 commit e2beb93
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion firestore-next/test.firestore.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion snippets/firestore-next/test-firestore/get_document.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]

0 comments on commit e2beb93

Please sign in to comment.