---
name: "mongoc_bulkwrite_t"
section: "3"
platform: "linux"
package: "libmongoc-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mongoc_bulkwrite_t"
---

# mongoc\_bulkwrite\_t(3)

## SYNOPSIS

```
typedef struct _mongoc_bulkwrite_t mongoc_bulkwrite_t;
```

## DESCRIPTION

*mongoc\_bulkwrite\_t* provides an abstraction for submitting multiple write operations as a single batch.

After adding all of the write operations to the *mongoc\_bulkwrite\_t*, call *mongoc\_bulkwrite\_execute()* to execute the operation.

**WARNING:**

It is only valid to call *mongoc\_bulkwrite\_execute()* once. The *mongoc\_bulkwrite\_t* must be destroyed afterwards.

**NOTE:**

If using MongoDB server 8.0+, prefer *mongoc\_bulkwrite\_t* over *mongoc\_bulk\_operation\_t* to reduce network round trips.

*mongoc\_bulkwrite\_t* uses the **bulkWrite** server command introduced in MongoDB server 8.0. **bulkWrite** command supports insert, update, and delete operations in the same payload. **bulkWrite** supports use of multiple collection namespaces in the same payload.

*mongoc\_bulk\_operation\_t* uses the **insert**, **update** and **delete** server commands available in all current MongoDB server versions. Write operations are grouped by type (insert, update, delete) and sent in separate commands. Only one collection may be specified per bulk write.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
