---
name: "mongoc_collection_destroy"
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_destroy"
---

# mongoc\_collection\_destroy(3)

## SYNOPSIS

```
void
mongoc_collection_destroy (mongoc_collection_t *collection);
```

## PARAMETERS

- •

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

## DESCRIPTION

This function shall destroy a *mongoc\_collection\_t* and its associated resources. Does nothing if **collection** is NULL.

**WARNING:**

Always destroy a *mongoc\_cursor\_t* created from a collection before destroying the collection.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
