The documentation for updating a document reference with Cloud Firestore shows how to update a single field:
const res = await cityRef.update({capital: true});
(https://firebase.google.com/docs/firestore/manage-data/add-data)
What if I want to update multiple fields of the document from the body of a PUT request?
For example, if my request.body
is
{
name: "Chicago"
capital: true
}
Is there someway to update the doc in a single call, such as cityRef.update(request.body}
?