---
name: "mongoc_uri_get_compressors"
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_uri_get_compressors"
---

# mongoc\_uri\_get\_compressors(3)

## SYNOPSIS

```
const bson_t *
mongoc_uri_get_compressors (const mongoc_uri_t *uri);
```

## PARAMETERS

- •

  **uri**: A *mongoc\_uri\_t*.

## DESCRIPTION

Returns a bson document with the enabled compressors as the keys or an empty document if no compressors were provided.

## EXAMPLE

```
mongoc_client_t *client;
mongoc_uri_t *uri;
uri = mongoc_uri_new ("mongodb://localhost/?compressors=zlib,snappy,zstd");
if (bson_has_field (mongoc_uri_get_compressors (uri), "snappy")) {
   /* snappy enabled */
}
```

## RETURNS

A bson\_t \* which should not be modified or freed.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
