---
name: "mongoc_auto_encryption_opts_set_encrypted_fields_map"
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_auto_encryption_opts_set_encrypted_fields_map"
---

# mongoc\_auto\_encryption\_opts\_set\_encrypted\_fields\_map(3)

## SYNOPSIS

```
void
mongoc_auto_encryption_opts_set_encrypted_fields_map (
   mongoc_auto_encryption_opts_t *opts, const bson_t *encrypted_fields_map);
```

Added in version 1.22.0.

## PARAMETERS

- •

  **opts**: The *mongoc\_auto\_encryption\_opts\_t*

- •

  **encrypted\_fields\_map**: A *bson\_t* where keys are collection namespaces and values are encrypted fields documents.

Supplying an **encrypted\_fields\_map** provides more security than relying on an **encryptedFields** obtained from the server. It protects against a malicious server advertising a false **encryptedFields**.

The schema map does not apply to collections encrypted with: *Queryable Encryption*. See *mongoc\_auto\_encryption\_opts\_set\_schema\_map()* instead.

**SEE ALSO:**

```
mongoc_client_enable_auto_encryption()
```

```
In-Use Encryption
```

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
