We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
batch.update() func returns WriteBatch instance itself, not Promise. So await is not needed.
// update changes to restaurant async function updateRestaurant(db: Firestore, restaurantID: string, name: string) { const updateRef = db.collection('reviews'); // query a list of reviews of the restaurant const queryRef = updateRef.where('restaurantID', '==', restaurantID); const batch = db.batch(); const reviewsSnapshot = await queryRef.get(); for (const doc of reviewsSnapshot.docs) { await batch.update(doc.ref, {restaurantName: name}); <--- HERE! }; await batch.commit(); console.log(`name of restaurant updated to ${name}`); }
The text was updated successfully, but these errors were encountered:
Good catch! At some point, I promise we'll revise this codelab, and I'll make sure to incorporate your feedback.
Sorry, something went wrong.
No branches or pull requests
Option 2: Change data server-side with Cloud Functions
batch.update() func returns WriteBatch instance itself, not Promise. So await is not needed.
The text was updated successfully, but these errors were encountered: