Home > @firebase/firestore > / > WriteBatch > commit
WriteBatch.commit() method
Commits all of the writes in this write batch as a single atomic unit.
The result of these writes will only be reflected in document reads that occur after the returned Promise resolves. If the client is offline, the write fails. If you would like to see local modifications or buffer writes until the client is online, use the full Firestore SDK.
Signature:
commit(): Promise<void>;
Returns:
Promise<void>
A Promise resolved once all of the writes in the batch have been successfully written to the backend as an atomic unit (note that it won't resolve while you're offline).