1MONGOC_URI_GET_MECHANISM_PROPERTIES(l3i)bmonMgOoNcGOC_URI_GET_MECHANISM_PROPERTIES(3)
2
3
4

NAME

6       mongoc_uri_get_mechanism_properties  - mongoc_uri_get_mechanism_proper‐
7       ties()
8

SYNOPSIS

10          bool
11          mongoc_uri_get_mechanism_properties (const mongoc_uri_t *uri,
12                                               bson_t *properties /* OUT */);
13

PARAMETERS

15uri: A mongoc_uri_t.
16
17properties: An uninitialized bson_t.
18

DESCRIPTION

20       Fetches the "authMechanismProperties" options set on this mongoc_uri_t.
21       The  out-parameter  properties  should be an uninitialized, stack-allo‐
22       cated bson_t. It is statically initialized with  bson_init_static()  to
23       point to the internal data of uri, so its contents must not be modified
24       and it becomes invalid after uri is destroyed.
25

RETURNS

27       If no "authMechanismProperties" have been set on  uri,  this  functions
28       returns false and properties remains uninitialized.
29

EXAMPLE

31          mongoc_uri_t *uri;
32          bson_t props;
33
34          uri = mongoc_uri_new (
35             "mongodb://user%40DOMAIN.COM:password@localhost/?authMechanism=GSSAPI"
36             "&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:true");
37
38          if (mongoc_uri_get_mechanism_properties (uri, &props)) {
39             char *json = bson_as_canonical_extended_json (&props, NULL);
40             printf ("%s\n", json);
41             bson_free (json);
42          } else {
43             printf ("No authMechanismProperties.\n");
44          }
45
46       This code produces the output:
47
48          { "SERVICE_NAME" : "other", "CANONICALIZE_HOST_NAME" : "true" }
49

AUTHOR

51       MongoDB, Inc
52
54       2017-present, MongoDB, Inc
55
56
57
58
591.20.0                           Nov 18,M2O0N2G1OC_URI_GET_MECHANISM_PROPERTIES(3)
Impressum