<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:35:18 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-938] cannot convert types that use mgobson.ObjectId to new bson library.</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-938</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;We currently have a number of types which have _id fields that are specified as strings, but take advantage of the fact that these will safely old mgobson&apos;s objectid. The hardest part of this, is that we use these structs in some situation where we specify our own ID value as a string)&lt;/p&gt;

&lt;p&gt;In order to migrate to the new bson library we&apos;ll need some way of handling these OID types. &lt;/p&gt;</description>
                <environment></environment>
        <key id="732484">GODRIVER-938</key>
            <summary>cannot convert types that use mgobson.ObjectId to new bson library.</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="13201">Fixed</resolution>
                                        <assignee username="isabella.siu@mongodb.com">Isabella Siu</assignee>
                                    <reporter username="sam.kleinman">Sam Kleinman</reporter>
                        <labels>
                            <label>evg</label>
                            <label>mgocompat</label>
                    </labels>
                <created>Mon, 8 Apr 2019 14:16:06 +0000</created>
                <updated>Sat, 28 Oct 2023 11:38:59 +0000</updated>
                            <resolved>Wed, 15 Jan 2020 21:45:21 +0000</resolved>
                                                    <fixVersion>1.3.0</fixVersion>
                                    <component>BSON</component>
                                        <votes>1</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="2732909" author="isabella.siu" created="Wed, 15 Jan 2020 21:45:21 +0000"  >&lt;p&gt;With changes for mgocompat, ObjectIDs will decode to strings. To have them decode like mgo&apos;s, use the mgocompat.MgoRegistry.&lt;/p&gt;</comment>
                            <comment id="2210417" author="samk" created="Thu, 11 Apr 2019 21:42:53 +0000"  >&lt;p&gt;I mean, I think the trivial example should (mostly) work once you create session/client objects. &lt;/p&gt;

&lt;p&gt;The problem is that when you insert an empty document, MGO creates an object ID, and you could read it back with mgo because objectids are strings.&lt;/p&gt;

&lt;p&gt;If did a query in mongo-driver using this structure, it would error because the type of the ID field wouldn&apos;t be correct. &lt;/p&gt;</comment>
                            <comment id="2210286" author="kris.brandow" created="Thu, 11 Apr 2019 20:28:32 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=sam.kleinman&quot; class=&quot;user-hover&quot; rel=&quot;sam.kleinman&quot;&gt;sam.kleinman&lt;/a&gt;, if I understand correctly, when you insert an &lt;tt&gt;example&lt;/tt&gt; instance with the &lt;tt&gt;ID&lt;/tt&gt; field unset, then &lt;tt&gt;mgo&lt;/tt&gt; would create an ObjectID for it. What happens if you read one of these objects and then write it back to the database? From what we can surmise &lt;tt&gt;mgo&lt;/tt&gt; would attempt to write the &lt;tt&gt;_id&lt;/tt&gt; field into the database as a BSON String, which would be invalid because the &lt;tt&gt;_id&lt;/tt&gt; is immutable.&lt;/p&gt;</comment>
                            <comment id="2205742" author="samk" created="Mon, 8 Apr 2019 20:11:32 +0000"  >&lt;p&gt;the minimal example is 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;   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;type example struct{ &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;    ID string `bson:&quot;_id,omitempty&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;   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;}&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;ex := &amp;amp;example{}&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;mgo.Session().DB(&quot;test&quot;).C(&quot;test&quot;).Insert(ex)&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;err := mongo.Client.Database(&quot;test&quot;).Collection(&quot;test&quot;).FindOne(nil).Decode(ex)&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;It definitely happens for this type: &lt;a href=&quot;https://github.com/evergreen-ci/evergreen/blob/master/model/task/task.go#L54&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/evergreen-ci/evergreen/blob/master/model/task/task.go#L54&lt;/a&gt; &lt;/p&gt;</comment>
                            <comment id="2205734" author="ian@10gen.com" created="Mon, 8 Apr 2019 20:07:22 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=sam.kleinman&quot; class=&quot;user-hover&quot; rel=&quot;sam.kleinman&quot;&gt;sam.kleinman&lt;/a&gt; can you give us an example struct that worked with mgo and any example usage that would help clarify?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="883798">GODRIVER-1216</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="735148">GODRIVER-953</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>GODRIVER-226</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr779b:</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>