<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:22:04 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[DRIVERS-662] Add a URI param and supporting API to enable a default database </title>
                <link>https://jira.mongodb.org/browse/DRIVERS-662</link>
                <project id="10980" key="DRIVERS">Drivers</project>
                    <description>&lt;p&gt;Add a named parameter to the URI to support default db&lt;br/&gt;
Add client APIs to &quot;use&quot; the specified default DB.&lt;/p&gt;</description>
                <environment></environment>
        <key id="787729">DRIVERS-662</key>
            <summary>Add a URI param and supporting API to enable a default database </summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="12300">Won&apos;t Do</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="scott.lhommedieu@mongodb.com">Scott L&apos;Hommedieu</reporter>
                        <labels>
                    </labels>
                <created>Mon, 3 Jun 2019 18:41:21 +0000</created>
                <updated>Mon, 13 Apr 2020 16:54:46 +0000</updated>
                            <resolved>Mon, 13 Apr 2020 16:54:46 +0000</resolved>
                                                                            <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="2269560" author="jmikola@gmail.com" created="Mon, 3 Jun 2019 20:21:56 +0000"  >&lt;p&gt;Just saw &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=behackett&quot; class=&quot;user-hover&quot; rel=&quot;behackett&quot;&gt;behackett&lt;/a&gt;&apos;s response in Slack about preferring not to use a new URI option. In that case, I&apos;d propose the following spec language:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;If a driver provides an API for accessing a default database, that driver MUST infer the default database&apos;s name from the `/database` component of the URI&lt;/p&gt;&lt;/blockquote&gt;</comment>
                            <comment id="2269559" author="david.golden" created="Mon, 3 Jun 2019 20:21:46 +0000"  >&lt;p&gt;The URI path database is not spec&apos;d as the default for any other purpose than auth, but in the wild, it is used as such.&#160; E.g.:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;$ mongodump -v --uri=mongodb://localhost/foo&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;2019-06-03T15:51:48.442-0400    dumping up to 1 collections in parallel&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;2019-06-03T15:51:48.442-0400    writing foo.bar to&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;2019-06-03T15:51:48.445-0400    done dumping foo.bar (1 document)&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;Spelunking into history, the &lt;tt&gt;authSource&lt;/tt&gt; parameter appears to be introduced to an early draft about driver auth for what later became the auth spec in this wiki page: &lt;a href=&quot;https://wiki.corp.mongodb.com/pages/viewpage.action?pageId=58687847&amp;amp;navigatingVersions=true&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://wiki.corp.mongodb.com/pages/viewpage.action?pageId=58687847&amp;amp;navigatingVersions=true&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That&apos;s before my time and the wiki has no discussion, so I have no context for why a parameter was introduced instead of using the database from the URI path &amp;#8211; whether that URI path database was already ambiguous in usage or not.  Possibly &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=behackett&quot; class=&quot;user-hover&quot; rel=&quot;behackett&quot;&gt;behackett&lt;/a&gt;, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jeff.yemin&quot; class=&quot;user-hover&quot; rel=&quot;jeff.yemin&quot;&gt;jeff.yemin&lt;/a&gt; or &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=craig.wilson%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;craig.wilson@mongodb.com&quot;&gt;craig.wilson@mongodb.com&lt;/a&gt; remember.&lt;/p&gt;

&lt;p&gt;I see no reason why we couldn&apos;t enshrine the URI path database as a &quot;default&quot; and allow users to use it for other things than auth.&lt;/p&gt;</comment>
                            <comment id="2269540" author="jmikola@gmail.com" created="Mon, 3 Jun 2019 20:10:22 +0000"  >&lt;blockquote&gt;&lt;p&gt;What we need is for all drivers to have a well defined way to get a database instance with that name from MongoClient.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I&apos;m not sure where this requirement is coming from (outside of the feature request in &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-914&quot; title=&quot;Configure Database Name From Mongo URI&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-914&quot;&gt;&lt;del&gt;GODRIVER-914&lt;/del&gt;&lt;/a&gt;), but I&apos;d question the necessity of introducing such an API on &lt;em&gt;all&lt;/em&gt; drivers at this point in time.&lt;/p&gt;

&lt;p&gt;Given the historic, documented usage of &lt;tt&gt;/database&lt;/tt&gt; in the URI to denote a default authentication database, I don&apos;t see any way to drivers to  introduce a new concept of a non-authentication &quot;default database&quot; (e.g. &lt;tt&gt;Client.getDefaultDatabase()&lt;/tt&gt;) without conflating the two. Have we considered introducing a &lt;tt&gt;defaultDatabaseName&lt;/tt&gt; URI option and having that fall back to the &lt;tt&gt;/database&lt;/tt&gt; component as &lt;tt&gt;authSource&lt;/tt&gt; does? That would at least allow us to disambiguate both options while still supporting the old syntax for users that can&apos;t be bothered to upgrade.&lt;/p&gt;

&lt;p&gt;That said, I&apos;d still prefer to see this introduced as an optional API.&lt;/p&gt;</comment>
                            <comment id="2269453" author="scott.lhommedieu" created="Mon, 3 Jun 2019 19:34:09 +0000"  >&lt;p&gt;Am I applying the &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/connection-string/connection-string-spec.rst#auth-database-optional&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;connection string spec&lt;/a&gt; to literally?  &lt;br/&gt;
As stated in that spec the path component is the authentication database but it does not indicate it being the default for any other purpose.   &lt;/p&gt;

&lt;p&gt;If I&apos;m reading that correctly and if a default database (and related API) is indeed valuable, the auth DB and the default DB should be disambiguated.  Whether there is only one way in the URI to set them or not is debatable but that isn&apos;t clear in the current specs.&lt;/p&gt;

&lt;p&gt;And yes an update to specs would be needed in order to describe the use of the declared default database.  The definition on the use of a default database only seems dependent on such a notion of a default and not on how it is declared.&lt;/p&gt;</comment>
                            <comment id="2269405" author="behackett" created="Mon, 3 Jun 2019 19:09:28 +0000"  >&lt;p&gt;We don&apos;t need a named parameter. Just pass the database name like so:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;mongodb://user:password@host/database&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;All drivers already support that for authentication. What we need is for all drivers to have a well defined way to get a database instance with that name from MongoClient. A number of drivers already have such an API. See for example:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://api.mongodb.com/python/current/api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.get_default_database&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://api.mongodb.com/python/current/api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient.get_default_database&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="726866">GODRIVER-914</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                            <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hus0lb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>