Skip site navigation (1)Skip section navigation (2)

  
 
  

home | help
MONGOC_URI_NEW_WITH_ERROR(3)	    libmongoc	    MONGOC_URI_NEW_WITH_ERROR(3)

SYNOPSIS
	mongoc_uri_t *
	mongoc_uri_new_with_error (const char *uri_string,
				   bson_error_t *error);

PARAMETERS
     * uri_string: A string containing a URI.

     * error: An optional location for a bson_error_t or NULL.

DESCRIPTION
     Parses a string containing a MongoDB style URI connection string.

RETURNS
     A newly allocated mongoc_uri_t if successful. Otherwise NULL populating er-
     ror with the error description.

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

EXAMPLES
     Examples of some valid MongoDB connection strings can be seen below.

     "mongodb://localhost/"

     "mongodb://localhost/?replicaSet=myreplset"

     "mongodb://myuser:mypass@localhost/"

     "mongodb://kerberosuser%40EXAMPLE.COM@example.com/?authMechanism=GSSAPI"

     "mongodb://[::1]:27017/"

     "mongodb://10.0.0.1:27017,10.0.0.1:27018,[::1]:27019/?tls=true"

     "mongodb://%2Ftmp%2Fmongodb-27017.sock"

     "mongodb://user:pass@%2Ftmp%2Fmongodb-27017.sock"

     "mongodb://localhost,[::1]/mydb?authSource=mydb"

AUTHOR
     MongoDB, Inc

COPYRIGHT
     2009-present, MongoDB, Inc.

1.30.8				  Aug 27, 2026	    MONGOC_URI_NEW_WITH_ERROR(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=mongoc_uri_new_with_error&sektion=3&manpath=FreeBSD+Ports+15.1.quarterly>

home | help