<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:34:48 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-713] Remove string key restriction for Encoder and Decoder lookups</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-713</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;The &lt;tt&gt;LookupEncoder&lt;/tt&gt; and &lt;tt&gt;LookupDecoder&lt;/tt&gt; methods on &lt;tt&gt;bsoncodec.Registry&lt;/tt&gt; prevent looking up a default codec for maps with non-string keys. While the default map encoder and decoder does not support non-string keys, users who wish to do so should be able to register their own default encoder and decoder for maps with non-string keys. Users can already register a default map encoder or decoder that handles non-string keys.&lt;/p&gt;

&lt;p&gt;Remove the check from &lt;tt&gt;LookupEncoder&lt;/tt&gt; and &lt;tt&gt;LookupDecoder&lt;/tt&gt; that prevents returning the default map encoder or decoder if the map&apos;s key is not a string.&lt;/p&gt;

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

&lt;p&gt;(original description below)&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Why&#160;bson package cannot&#160;resolve map&lt;span class=&quot;error&quot;&gt;&amp;#91;int&amp;#93;&lt;/span&gt;int, while&#160;encoding/json and mgo can.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/globalsign/mgo/pull/140&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/globalsign/mgo/pull/140&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;I wrote a MapEncoder for myself, then call RegisterDefaultEncoder(). It is stuck in&lt;/p&gt;

&lt;p&gt;&#160;(r *Registry) LookupEncoder(t reflect.Type) (ValueEncoder, error) {&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;if t != nil &amp;amp;&amp;amp; t.Kind() == reflect.Map &amp;amp;&amp;amp; t.Key().Kind() != reflect.String&lt;/p&gt;

{ ... }

&lt;p&gt;I cannot implement a mapEncoder/Decoder without modifying this driver.&lt;/p&gt;

&lt;p&gt;Please&#160;support numeric map keys.&lt;/p&gt;</description>
                <environment></environment>
        <key id="655762">GODRIVER-713</key>
            <summary>Remove string key restriction for Encoder and Decoder lookups</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="divjot.arora@mongodb.com">Divjot Arora</assignee>
                                    <reporter username="825335693@qq.com">zhengyang zhu</reporter>
                        <labels>
                    </labels>
                <created>Mon, 17 Dec 2018 10:46:22 +0000</created>
                <updated>Sat, 28 Oct 2023 11:39:15 +0000</updated>
                            <resolved>Wed, 30 Jan 2019 16:04:38 +0000</resolved>
                                                    <fixVersion>0.3.0</fixVersion>
                                    <component>BSON</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="2132065" author="xgen-internal-githook" created="Wed, 30 Jan 2019 16:04:11 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;username&apos;: &apos;divjotarora&apos;, &apos;email&apos;: &apos;divjot.arora@10gen.com&apos;, &apos;name&apos;: &apos;Divjot Arora&apos;}
&lt;p&gt;Message: Remove string key restriction for maps in LookupEncoder/LookupDecoder.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-713&quot; title=&quot;Remove string key restriction for Encoder and Decoder lookups&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-713&quot;&gt;&lt;del&gt;GODRIVER-713&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Change-Id: Id30100a8bdb64f9cea15b42449632583a41e9f07&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/commit/769f6da9b23d5c239b3550df016a03abde60ec0b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/commit/769f6da9b23d5c239b3550df016a03abde60ec0b&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2106172" author="kris.brandow" created="Fri, 4 Jan 2019 21:58:06 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=825335693%40qq.com&quot; class=&quot;user-hover&quot; rel=&quot;825335693@qq.com&quot;&gt;825335693@qq.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;While we don&apos;t support non-string keys by default, there we shouldn&apos;t prevent users from doing so. For now, you should be able to register a codec for &lt;tt&gt;map&lt;span class=&quot;error&quot;&gt;&amp;#91;int&amp;#93;&lt;/span&gt;int&lt;/tt&gt; via the &lt;tt&gt;RegisterEncoder&lt;/tt&gt; method.&lt;/p&gt;

&lt;p&gt;--Kris&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|hr8c1j:</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>