---
name: "mongoc_uri_copy"
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_copy"
---

# mongoc\_uri\_copy(3)

## SYNOPSIS

```
mongoc_uri_t *
mongoc_uri_copy (const mongoc_uri_t *uri);
```

## PARAMETERS

- •

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

## DESCRIPTION

Copies the entire contents of a URI.

## RETURNS

A newly allocated *mongoc\_uri\_t* that should be freed with *mongoc\_uri\_destroy()*. May return **NULL** on invalid host.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
