---
name: "mongoc_database_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_database_set_write_concern"
---

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

## SYNOPSIS

```
void
mongoc_database_set_write_concern (mongoc_database_t *database,
                                   const mongoc_write_concern_t *write_concern);
```

This function sets the write concern to use on operations performed with **database**. Collections created with *mongoc\_database\_get\_collection()* after this call will inherit this write concern.

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.

## PARAMETERS

- •

  **database**: A *mongoc\_database\_t*.

- •

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

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
