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_GET_MECHANISM_PROPERTIES(3) libmongoc MONGOC_URI_GET_MECHANISM_PROPERTIES(3)

bool
mongoc_uri_get_mechanism_properties (const mongoc_uri_t *uri,

bson_t *properties /* OUT */);


  • uri: A mongoc_uri_t.
  • properties: An uninitialized bson_t.

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

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

mongoc_uri_t *uri;
bson_t props;
uri = mongoc_uri_new (

"mongodb://user%40DOMAIN.COM:password@localhost/?authMechanism=GSSAPI"
"&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:true"); if (mongoc_uri_get_mechanism_properties (uri, &props)) {
char *json = bson_as_canonical_extended_json (&props, NULL);
printf ("%s\n", json);
bson_free (json); } else {
printf ("No authMechanismProperties.\n"); }


This code produces the output:

{ "SERVICE_NAME" : "other", "CANONICALIZE_HOST_NAME" : "true" }


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.