---
name: "mongoc_uri_new"
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_new"
---

# mongoc\_uri\_new(3)

## SYNOPSIS

```
mongoc_uri_t *
mongoc_uri_new (const char *uri_string);
```

## PARAMETERS

- •

  **uri\_string**: A string containing a URI.

## DESCRIPTION

Calls *mongoc\_uri\_new\_with\_error()*.

## RETURNS

A newly allocated *mongoc\_uri\_t* if successful. Otherwise **NULL**, using MONGOC\_WARNING on error.

**WARNING:**

Failure to handle the result of this function is a programming error.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
