<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:36:56 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-1701] Add structcodec option equivalent to mgo&apos;s useJSONTagFallback</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-1701</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;&lt;b&gt;NEW DESCRIPTION&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;mgo supports a non-default option to fallback to using json tags for structs when bson tags aren&apos;t present, so an option should be added to StructCodec to do the same.&lt;/p&gt;

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

&lt;p&gt;&lt;b&gt;PREVIOUS DESCRIPTION&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Basically if you have a struct that has something like:&lt;/p&gt;

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

&lt;p&gt;```&lt;/p&gt;

&lt;p&gt;WsId&#160; &#160; &#160; &#160; &#160;string&#160; &#160; &#160; `json:&quot;ws_id&quot;`&lt;/p&gt;

&lt;p&gt;```&lt;/p&gt;

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

&lt;p&gt;Running find() on a collection will not return the ws_id field for the document, but if you define the struct as:&lt;/p&gt;

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

&lt;p&gt;```&lt;/p&gt;

&lt;p&gt;Ws_Id&#160; &#160; &#160; &#160; &#160;string&#160; &#160; &#160; `json:&quot;ws_id&quot;`&lt;/p&gt;

&lt;p&gt;```&lt;/p&gt;

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

&lt;p&gt;It will work.&lt;/p&gt;

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

&lt;p&gt;Read this -&#160;&lt;a href=&quot;https://github.com/golang/go/issues/40351&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/golang/go/issues/40351&lt;/a&gt;&lt;/p&gt;</description>
                <environment>Linux 4.9, Mongo 3.6.14</environment>
        <key id="1417474">GODRIVER-1701</key>
            <summary>Add structcodec option equivalent to mgo&apos;s useJSONTagFallback</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="13201">Fixed</resolution>
                                        <assignee username="isabella.siu@mongodb.com">Isabella Siu</assignee>
                                    <reporter username="andrewhodel@gmail.com">Andrew Hodel</reporter>
                        <labels>
                            <label>mgocompat</label>
                    </labels>
                <created>Wed, 22 Jul 2020 20:35:39 +0000</created>
                <updated>Sat, 28 Oct 2023 11:38:05 +0000</updated>
                            <resolved>Fri, 21 Aug 2020 14:15:46 +0000</resolved>
                                    <version>1.3.5</version>
                                    <fixVersion>1.5.0</fixVersion>
                                    <component>BSON</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="3352178" author="xgen-internal-githook" created="Fri, 21 Aug 2020 14:11:13 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Isabella Siu&apos;, &apos;email&apos;: &apos;sakurablossom@blueblueworld.com&apos;, &apos;username&apos;: &apos;iwysiu&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-1701&quot; title=&quot;Add structcodec option equivalent to mgo&amp;#39;s useJSONTagFallback&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-1701&quot;&gt;&lt;del&gt;GODRIVER-1701&lt;/del&gt;&lt;/a&gt; add JsonFallbackStructTagParser (#480)&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/commit/04b7cf242d9607b8ee1b53c9b8768da90e2348b4&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/commit/04b7cf242d9607b8ee1b53c9b8768da90e2348b4&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3344929" author="JIRAUSER1251601" created="Tue, 18 Aug 2020 13:51:37 +0000"  >&lt;p&gt;Without a doubt, it is just such a square and easy solution.&lt;/p&gt;</comment>
                            <comment id="3331652" author="isabella.siu" created="Mon, 10 Aug 2020 21:44:05 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=andrewhodel%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;andrewhodel@gmail.com&quot;&gt;andrewhodel@gmail.com&lt;/a&gt;&#160;Different tag names allow us to support a different set of options from the json library, so we will not support parsing json tags by default. For example, the xml and json libraries do not support parsing each other&apos;s tags. However, as mgo did offer an option to turn on using json tags as a fallback, we will add it as an option to our structcodec.&lt;/p&gt;</comment>
                            <comment id="3331532" author="JIRAUSER1251601" created="Mon, 10 Aug 2020 20:42:50 +0000"  >&lt;p&gt;That&apos;s not the truth here though, you are decreasing your user base by not fixing this.&lt;/p&gt;

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

&lt;p&gt;Most people just write json in the struct, what&apos;s the point of not doing it to make a better product?&lt;/p&gt;

&lt;p&gt;It is the user interface/access level of the project, nobody really asks for features but this is a pure software bug.&#160; It seems to contradict the project not to make this right for the users.&lt;/p&gt;</comment>
                            <comment id="3331525" author="isabella.siu" created="Mon, 10 Aug 2020 20:35:53 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=andrewhodel%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;andrewhodel@gmail.com&quot;&gt;andrewhodel@gmail.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;If you would like to use multiple struct tags, you can use this syntax:&#160;&lt;/p&gt;

&lt;p&gt;WsId&#160;&#160;&#160;&#160;&#160;string&#160;&#160;&#160;`bson:&#8220;ws_id&#8221; json:&#8220;ws_id&#8221;`&lt;/p&gt;</comment>
                            <comment id="3331492" author="JIRAUSER1251601" created="Mon, 10 Aug 2020 20:21:30 +0000"  >&lt;p&gt;How often is it that you retrieve BSON data that you aren&apos;t using a json api?&lt;/p&gt;

&lt;p&gt;Or, Dude if it&apos;s mongodb you are using json.&lt;/p&gt;</comment>
                            <comment id="3331473" author="JIRAUSER1251601" created="Mon, 10 Aug 2020 20:12:47 +0000"  >&lt;p&gt;No, because I am still using JSON in other places.&lt;/p&gt;

&lt;p&gt;Why close the issue, it&apos;s not resolved.&#160; It has to work with both as that&apos;s how people define it.&lt;/p&gt;</comment>
                            <comment id="3310538" author="isabella.siu" created="Tue, 28 Jul 2020 18:39:31 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=andrewhodel%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;andrewhodel@gmail.com&quot;&gt;andrewhodel@gmail.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;For bson decoding, you should use bson struct tags instead of json ones, so instead you would use:&lt;/p&gt;

&lt;p&gt;WsId&#160; &#160; &#160; &#160; &#160;string&#160; &#160; &#160; `bson:&quot;ws_id&quot;`&lt;/p&gt;

&lt;p&gt;Does this solve your issue?&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|hr773z:</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>