---
name: "mongoc_collection_create_bulk_operation"
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_collection_create_bulk_operation"
---

# mongoc\_collection\_create\_bulk\_operation(3)

**WARNING:**

Deprecated since version 1.9.0: Use *mongoc\_collection\_create\_bulk\_operation\_with\_opts()* instead.

## SYNOPSIS

```
mongoc_bulk_operation_t *
mongoc_collection_create_bulk_operation (
   mongoc_collection_t *collection,
   bool ordered,
   const mongoc_write_concern_t *write_concern);
```

## PARAMETERS

- •

  **collection**: A *mongoc\_collection\_t*.

- •

  **ordered**: If the operations must be performed in order.

- •

  **write\_concern**: An optional *mongoc\_write\_concern\_t* or **NULL**.

## DESCRIPTION

This function shall begin a new bulk operation. After creating this you may call various functions such as *mongoc\_bulk\_operation\_update()*, *mongoc\_bulk\_operation\_insert()* and others.

After calling *mongoc\_bulk\_operation\_execute()* the commands will be executed in as large as batches as reasonable by the client.

If **ordered** is true, then processing will stop at the first error.

If **ordered** is not true, then the bulk operation will attempt to continue processing even after the first failure.

**write\_concern** contains the write concern for all operations in the bulk operation. If **NULL**, the collection's write concern is used. The global default is acknowledged writes: MONGOC\_WRITE\_CONCERN\_W\_DEFAULT.

## ERRORS

Errors are propagated when executing the bulk operation.

## RETURNS

A newly allocated *mongoc\_bulk\_operation\_t* that should be freed with *mongoc\_bulk\_operation\_destroy()* when no longer in use.

**WARNING:**

Failure to handle the result of this function is a programming error.

**SEE ALSO:**

```
Bulk Write Operations
```

*mongoc\_bulk\_operation\_t*

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
