<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:35:14 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>[GODRIVER-914] Configure Database Name From Mongo URI</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-914</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;When using `ClientOptions.ApplyURI` the Database is extracted from the uri inside the `parser.parse` method in `connstring.go`,&#160; but is then not set on `ClientOptions` (in fact this struct does not have a `Database` parameter) and is not passed through to the `Client` at all.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Coming from `globalsign/mgo` - we are using `session.DB(&quot;&quot;)` to allow use of the `defaultDb` inside `&lt;a href=&quot;#L898]&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;session.go&lt;/a&gt;` and I would like to see this or something similar implemented for your driver in the `Client.Database` method, as our database name is environment specific and it is far simpler for us to set this value in the mongo uri (one place) than to set it at an application level per environment.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;I am happy to create a PR to cover this feature and collaborate on this feature going forward, as we are very keen to migrate our applications away from mgo to the official driver, and this small fix would save a lot of configuration overhead for us.&lt;/p&gt;</description>
                <environment></environment>
        <key id="726866">GODRIVER-914</key>
            <summary>Configure Database Name From Mongo URI</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="scott.lhommedieu@mongodb.com">Scott L&apos;Hommedieu</assignee>
                                    <reporter username="Rossiar">Ross Henderson [X]</reporter>
                        <labels>
                    </labels>
                <created>Mon, 1 Apr 2019 12:14:54 +0000</created>
                <updated>Thu, 6 Aug 2020 18:51:44 +0000</updated>
                            <resolved>Thu, 30 May 2019 20:38:10 +0000</resolved>
                                    <version>1.0.0</version>
                                                    <component>Connections</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="2269331" author="scott.lhommedieu" created="Mon, 3 Jun 2019 18:45:14 +0000"  >&lt;p&gt;As I mentioned, track this in &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-662&quot; title=&quot;Add a URI param and supporting API to enable a default database &quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-662&quot;&gt;&lt;del&gt;DRIVERS-662&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="2265995" author="scott.lhommedieu" created="Thu, 30 May 2019 20:38:10 +0000"  >&lt;p&gt;Thanks for reporting this discrepancy between the mgo driver and the Mongodb Go Driver.&#160; This particular issue isn&apos;t something that is described in the Driver Specs and isn&apos;t done in any other of the supported MongoDB Drivers.&lt;/p&gt;

&lt;p&gt;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; currently dictates that the path parameter that you&apos;re referring to is the auth database.&#160;&#160;To prevent confusion of auth database vs default database we can&apos;t support this api.  &lt;/p&gt;

&lt;p&gt;There is potential to add a named parameter to the URI to support default db but that wouldn&apos;t be useful without other changes to the &quot;use&quot; that default in the rest of the client api. &lt;br/&gt;
I don&apos;t see any of that easing your migration burden.&lt;/p&gt;

&lt;p&gt;I&apos;ll open a Drivers ticket to further debate the merits of adding this behavior to the Drivers specs.&lt;/p&gt;</comment>
                            <comment id="2265940" author="scott.lhommedieu" created="Thu, 30 May 2019 20:16:16 +0000"  >&lt;p&gt;This should be handled as described in &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-637&quot; title=&quot;Specify behavior where connection string contain auth database but no credentials&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-637&quot;&gt;DRIVERS-637&lt;/a&gt; .&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-1021&quot; title=&quot;Specify behavior where connection string contain auth database but no credentials&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-1021&quot;&gt;&lt;del&gt;GODRIVER-1021&lt;/del&gt;&lt;/a&gt;&#160;tracks that work.&lt;/p&gt;</comment>
                            <comment id="2198085" author="david.golden" created="Mon, 1 Apr 2019 18:09:40 +0000"  >&lt;blockquote&gt;&lt;p&gt;this brings up the larger question of why the URI allows us to configure the authSource in this way&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;The (admittedly not very satisfying) answer is that it was a legacy design decision that has persisted for backwards-compatibility reasons.&lt;/p&gt;

&lt;p&gt;Thanks for raising this ticket &amp;#8211; we will give this some thought.  At the very least, we need better documentation for users migrating from mgo.&lt;/p&gt;</comment>
                            <comment id="2198049" author="rossiar" created="Mon, 1 Apr 2019 17:55:15 +0000"  >&lt;p&gt;Thanks for your response David, I was not aware of this, largely because it seems confusing to provide the database in the uri as a default authSource when you can also specify &lt;tt&gt;}}&lt;a href=&quot;#urioption.authSource&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;it as a connection string parameter&lt;/a&gt;], which would override the value anyway (stopping us from using {{opt.Auth.AuthSource&lt;/tt&gt;&#160;as above).&lt;/p&gt;

&lt;p&gt;We are using a uri like this:&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:&lt;/span&gt;&lt;span style=&quot;color: #008200; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;//my-service:pass12345@shard-01:27017,shard-02:27017,shard-03:27017/my-service?ssl=true&amp;amp;authSource=admin&lt;/span&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;&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;I believe that we can solve our use case for now by configuring our client with a uri 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:&lt;/span&gt;&lt;span style=&quot;color: #008200; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;//my-service:pass12345@shard-01:27017,shard-02:27017,shard-03:27017/?ssl=true&lt;/span&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;&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;and then using &lt;tt&gt;client.Database(&quot;my-service&quot;)&lt;/tt&gt;&#160;to configure the database to use.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Although this brings up the larger question of why the URI allows us to configure the authSource in this way, I think it means we can discard the idea of implementing this feature for the current driver, as using this parameter for a default database does not seem correct to me now that I have taken a closer look at the documentation you&apos;ve provided. Perhaps a clarification could be made to the documentation somewhere, as this seems somewhat of a gotcha for users that are migrating from mgo, but I cannot see a good place to document this myself.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;If you have a suggestion of what could be improved I&apos;d welcome it, but otherwise I&apos;m happy for you to close this ticket, and thanks again for your time in helping me resolve this.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="2197910" author="david.golden" created="Mon, 1 Apr 2019 16:27:38 +0000"  >&lt;p&gt;Before considering the merits of your request, I want mention that the &apos;database&apos; string in that part of the URI is intended and documented to &lt;a href=&quot;https://docs.mongodb.com/manual/reference/connection-string/index.html#components&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;represent the authentication database&lt;/a&gt;, not a &quot;default&quot; database (though some tools/libraries do treat it that way)&#160; It&apos;s not well documented currently, but because it&apos;s an alternative for the &lt;tt&gt;authSource&lt;/tt&gt; URI parameter, you can access it via the &lt;tt&gt;ClientOptions.Auth.AuthSource&lt;/tt&gt; field:&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;	opt := options.Client().ApplyURI(&quot;mongodb://localhost/foo&quot;)&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;	fmt.Println(opt.Auth.AuthSource) // &quot;foo&quot;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="787729">DRIVERS-662</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                    <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[5002K00000oe6ZAQAY]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <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|huo4zb:</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>