.\" This manpage is Copyright (C) 2016 MongoDB, Inc. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.3 .\" or any later version published by the Free Software Foundation; .\" with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. .\" A copy of the license is included in the section entitled "GNU .\" Free Documentation License". .\" .TH "MONGOC_URI_NEW" "3" "2016\(hy10\(hy12" "MongoDB C Driver" .SH NAME mongoc_uri_new() \- Parses a string containing a MongoDB style URI connection string. .SH "SYNOPSIS" .nf .nf mongoc_uri_t * mongoc_uri_new (const char *uri_string) BSON_GNUC_WARN_UNUSED_RESULT; .fi .fi .SH "PARAMETERS" .TP .B uri_string A string containing a URI. .LP .SH "DESCRIPTION" Parses a string containing a MongoDB style URI connection string. .SH "RETURNS" A newly allocated .B mongoc_uri_t if successful. Otherwise .B NULL . .B NOTE .RS Failure to handle the result of this function is a programming error. .RE .SH "EXAMPLES" Examples of some valid MongoDB connection strings can be seen below. .B "mongodb://localhost/" .B "mongodb://localhost/?replicaSet=myreplset" .B "mongodb://myuser:mypass@localhost/" .B "mongodb://kerberosuser%40EXAMPLE.COM@example.com/?authMechanism=GSSAPI" .B "mongodb://[::1]:27017/" .B "mongodb://10.0.0.1:27017,10.0.0.1:27018,[::1]:27019/?ssl=true" .B "mongodb:///tmp/mongodb-27017.sock" .B "mongodb://localhost,[::1]/mydb?authSource=mydb" .B .SH COLOPHON This page is part of MongoDB C Driver. Please report any bugs at https://jira.mongodb.org/browse/CDRIVER.