<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@firebase/firestore](./firestore.md) &gt; [/](./firestore_.md) &gt; [writeBatch](./firestore_.writebatch.md)

## writeBatch() function

Creates a write batch, used for performing multiple writes as a single atomic operation. The maximum number of writes allowed in a single WriteBatch is 500.

Unlike transactions, write batches are persisted offline and therefore are preferable when you don't need to condition your writes on read data.

<b>Signature:</b>

```typescript
export declare function writeBatch(firestore: FirebaseFirestore): WriteBatch;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  firestore | [FirebaseFirestore](./firestore_.firebasefirestore.md) |  |

<b>Returns:</b>

[WriteBatch](./firestore_.writebatch.md)

A `WriteBatch` that can be used to atomically execute multiple writes.

