---
name: "mongoc_client_set_write_concern"
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_client_set_write_concern"
---

# mongoc\_client\_set\_write\_concern(3)

## SYNOPSIS

```
void
mongoc_client_set_write_concern (mongoc_client_t *client,
                                 const mongoc_write_concern_t *write_concern);
```

Sets the write concern for the client. This only affects future operations, collections, and databases inheriting from **client**.

The default write concern is MONGOC\_WRITE\_CONCERN\_W\_DEFAULT: the driver blocks awaiting basic acknowledgement of write operations from MongoDB. This is the correct write concern for the great majority of applications.

It is a programming error to call this function on a client from a *mongoc\_client\_pool\_t*. For pooled clients, set the write concern with the *MongoDB URI* instead.

## PARAMETERS

- •

  **client**: A *mongoc\_client\_t*.

- •

  **write\_concern**: A *mongoc\_write\_concern\_t*.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
