1MONGOC_URI_NEW_WITH_ERROR(3)       libmongoc      MONGOC_URI_NEW_WITH_ERROR(3)
2
3
4

NAME

6       mongoc_uri_new_with_error - mongoc_uri_new_with_error()
7

SYNOPSIS

9          mongoc_uri_t *
10          mongoc_uri_new_with_error (const char *uri_string,
11                                     bson_error_t *error) BSON_GNUC_WARN_UNUSED_RESULT;
12

PARAMETERS

14       · uri_string: A string containing a URI.
15
16       · error: An optional location for a bson_error_t or NULL.
17

DESCRIPTION

19       Parses a string containing a MongoDB style URI connection string.
20

RETURNS

22       A newly allocated mongoc_uri_t if successful. Otherwise NULL populating
23       error with the error description.
24
25       WARNING:
26          Failure to handle the result  of  this  function  is  a  programming
27          error.
28

EXAMPLES

30       Examples of some valid MongoDB connection strings can be seen below.
31
32       "mongodb://localhost/"
33
34       "mongodb://localhost/?replicaSet=myreplset"
35
36       "mongodb://myuser:mypass@localhost/"
37
38       "mongodb://kerberosuser%40EXAMPLE.COM@example.com/?authMechanism=GSS‐
39       API"
40
41       "mongodb://[::1]:27017/"
42
43       "mongodb://10.0.0.1:27017,10.0.0.1:27018,[::1]:27019/?ssl=true"
44
45       "mongodb://%2Ftmp%2Fmongodb-27017.sock"
46
47       "mongodb://user:pass@%2Ftmp%2Fmongodb-27017.sock"
48
49       "mongodb://localhost,[::1]/mydb?authSource=mydb"
50

AUTHOR

52       MongoDB, Inc
53
55       2017-present, MongoDB, Inc
56
57
58
59
601.16.2                           Feb 25, 2020     MONGOC_URI_NEW_WITH_ERROR(3)
Impressum