---
name: "mongoc_uri_get_database"
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_database"
---

# mongoc\_uri\_get\_database(3)

## SYNOPSIS

```
const char *
mongoc_uri_get_database (const mongoc_uri_t *uri);
```

## PARAMETERS

- •

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

## DESCRIPTION

Fetches the database portion of an URI if provided. This is the portion after the **/** but before the **?**.

## RETURNS

A string which should not be modified or freed or **NULL**.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
