<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:35:42 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-1111] type conversion like mgo</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-1111</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;With the old mgo library, type conversion were handled automatically.&lt;/p&gt;

&lt;p&gt;I have 2 issues while migrating an application:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;MongoDB field is a number, Go struct field is a string&lt;/li&gt;
	&lt;li&gt;MongoDB field contains null, Go struct field is a string&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The BSON library returns an error, because the types don&apos;t match.&lt;/p&gt;

&lt;p&gt;I understand that the mapping should be strict, and personally I think it&apos;s a good practice.&lt;/p&gt;

&lt;p&gt;However I don&apos;t have full control over the data managed by my company. Some developers use programming language with poor typing (JS), and they don&apos;t care about the type of data they insert.&lt;/p&gt;

&lt;p&gt;With the old mgo library, my code was working fine, because it was doing the type conversion for me. See &lt;a href=&quot;https://github.com/globalsign/mgo/blob/eeefdecb41b842af6dc652aaea4026e8403e62df/bson/decode.go#L820-L829&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/globalsign/mgo/blob/eeefdecb41b842af6dc652aaea4026e8403e62df/bson/decode.go#L820-L829&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I understand if you don&apos;t want to change the code of the official MongoDB driver.&lt;/p&gt;</description>
                <environment></environment>
        <key id="789885">GODRIVER-1111</key>
            <summary>type conversion like mgo</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="9">Done</resolution>
                                        <assignee username="divjot.arora@mongodb.com">Divjot Arora</assignee>
                                    <reporter username="pierrre">Pierre Durand</reporter>
                        <labels>
                    </labels>
                <created>Wed, 5 Jun 2019 13:52:31 +0000</created>
                <updated>Fri, 7 Jun 2019 14:14:19 +0000</updated>
                            <resolved>Fri, 7 Jun 2019 14:14:19 +0000</resolved>
                                    <version>1.0.2</version>
                                                    <component>BSON</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="2275719" author="divjot.arora" created="Fri, 7 Jun 2019 14:14:06 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=pierrre&quot; class=&quot;user-hover&quot; rel=&quot;pierrre&quot;&gt;pierrre&lt;/a&gt; Thank you for the BSON suggestions. This behavior can be achieved with a custom registry (seems like you&apos;d want a custom codec to unmarshal strings specifically for the issues you listed). We do have plans to create a set of codecs to provide mgo-compatibility later this quarter. You can track&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-226&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/GODRIVER-226&lt;/a&gt;&#160;for that work.&lt;/p&gt;</comment>
                            <comment id="2275127" author="pierrre" created="Thu, 6 Jun 2019 21:38:50 +0000"  >&lt;p&gt;After some investigation, I think that I can implement the old behavior with a custom registry.&#160;&lt;/p&gt;</comment>
                    </comments>
                    <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|husccn:</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>