From f9e44aad386e55bd6aded7f2ea576a6112b25971 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 3 Jun 2020 19:27:03 +0000 Subject: [PATCH] Clarify handling of database name URI component https://jira.mongodb.org/browse/PHPC-1384 git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@350007 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../mongodb/driver/manager/construct.xml | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/reference/mongodb/mongodb/driver/manager/construct.xml b/reference/mongodb/mongodb/driver/manager/construct.xml index 455bc8506e..d344f1db40 100644 --- a/reference/mongodb/mongodb/driver/manager/construct.xml +++ b/reference/mongodb/mongodb/driver/manager/construct.xml @@ -46,12 +46,12 @@ A mongodb:// connection URI: - For details on supported options, see + For details on supported URI options, see Connection String Options in the MongoDB manual. Connection pool options @@ -68,6 +68,15 @@ mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][ The rawurlencode function may be used to encode constituent parts of the URI. + + The defaultAuthDb component may be used to specify the + database name associated with the user's credentials; however the + authSource URI option will take priority if specified. + If neither defaultAuthDb nor + authSource are specified, the admin + database will be used by default. The defaultAuthDb + component has no effect in the absence of user credentials. + @@ -145,7 +154,8 @@ mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][ The database name associated with the user's credentials. Defaults - to the database component of the connection URI. + to the database component of the connection URI, or the + admin database if both are unspecified. For authentication mechanisms that delegate credential storage to @@ -1071,7 +1081,7 @@ $manager = new MongoDB\Driver\Manager("mongodb://mongos1.example.com,mongos2.exa ]]> @@ -1090,7 +1100,7 @@ $manager = new MongoDB\Driver\Manager("mongodb://myusername:mypassword@example.c ]]>