---
name: "mongoc_database_get_collection"
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_get_collection"
---

# mongoc\_database\_get\_collection(3)

## SYNOPSIS

```
mongoc_collection_t *
mongoc_database_get_collection (mongoc_database_t *database,
                                const char *name);
```

Allocates a new *mongoc\_collection\_t* structure for the collection named **name** in **database**.

## RETURNS

A newly allocated *mongoc\_collection\_t* that should be freed with *mongoc\_collection\_destroy()*.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
