GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
MONGOC_URI_NEW_WITH_ERROR(3) libmongoc MONGOC_URI_NEW_WITH_ERROR(3)

mongoc_uri_t *
mongoc_uri_new_with_error (const char *uri_string,

bson_error_t *error);


  • uri_string: A string containing a URI.
  • error: An optional location for a bson_error_t or NULL.

Parses a string containing a MongoDB style URI connection string.

A newly allocated mongoc_uri_t if successful. Otherwise NULL populating error with the error description.

WARNING:

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


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"

MongoDB, Inc

2009-present, MongoDB, Inc.

July 3, 2025 1.30.4

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.