firebase / firebase/snippets-web

missing keyword `await` for the set_with_merge.js file

Open
#330 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
802
Forks
285
PR merge metrics
No merged PRs in 30d

Description

The docs related to `Set a document` [see here](https://firebase.google.com/docs/firestore/manage-data/add-data?hl=en&authuser=0#add_a_document:~:text=If%20the%20document%20does%20not%20exist%2C%20it%20will%20be%20created.%20If%20the%20document%20does%20exist%2C%20its%20contents%20will%20be%20overwritten%20with%20the%20newly%20provided%20data%2C%20unless%20you%20specify%20that%20the%20data%20should%20be%20merged%20into%20the%20existing%20document%2C%20as%20follows%3A) are missing the keyword `await` before `setDoc()` function.
For the code example where the `{ merge: true}` is used.

![image](https://user-images.githubusercontent.com/16472274/222779344-719ae4ea-e430-4a30-8505-e024b712f40f.png)

All of the previous and subsequent code snippets do contain the word `await` for the `setDoc()` function. Does the `{merge: true}` change the async behavior of the `setDoc()` function?

If not, the `await` should be present in that snippet to match all of the other code snippets for this page.

Here's another example on the same page where the `await` keyword is present for the `setDoc()` function:

![image](https://user-images.githubusercontent.com/16472274/222780749-32389c20-a556-4854-98e3-3227a9c4e68d.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.