<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:34:37 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-636] Add documentation on how to set a custom bsoncodec.Registry</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-636</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;At the moment it is not obvious how to set a custom registry, such that it is used both when writing to mongo and reading with a cursor.&lt;/p&gt;

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

&lt;p&gt;Bellow an example of what is I had to do to get this t work:&lt;/p&gt;

&lt;p&gt;&#160;&lt;br/&gt;
rb := bson.NewRegistryBuilder()&lt;/p&gt;

&lt;p&gt;&#160;&#160;&#160;&#160;cod := &amp;amp;UUIDCodec{}&lt;br/&gt;
&#160;&#160;&#160;&#160;tUUID := reflect.TypeOf(uuid.UUID{})&lt;/p&gt;

&lt;p&gt;&#160;&#160;&#160;&#160;rb.RegisterDecoder(reflect.PtrTo(tUUID), bsoncodec.ValueDecoderFunc(cod.DecodeValue))&lt;br/&gt;
&#160;&#160;&#160;&#160;rb.RegisterEncoder(reflect.PtrTo(tUUID), cod)&lt;/p&gt;

&lt;p&gt;&#160;&#160;&#160;&#160;reg := rb.Build()&lt;/p&gt;

&lt;p&gt;&#160;&#160;&#160;&#160;opt := &amp;amp;options.ClientOptions{&lt;br/&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Registry: reg,&lt;br/&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;TopologyOptions: []topology.Option{&lt;br/&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;topology.WithServerOptions(func(opts ...topology.ServerOption) []topology.ServerOption {&lt;br/&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return []topology.ServerOption{&lt;br/&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;topology.WithRegistry(func(r *bsoncodec.Registry) *bsoncodec.Registry &lt;/p&gt;
{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return reg
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}
&lt;p&gt;),&lt;br/&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}&lt;br/&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}),&lt;br/&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;},&lt;br/&gt;
&#160;&#160;&#160;&#160;}&lt;br/&gt;
&#160;&lt;br/&gt;
Adding this or something similar as an example, or even pushing this code into the SetRegistry method of the mongo.Options would be helpful.&lt;/p&gt;


&lt;p&gt;&#160;&#160;&#160;&#160;client, err := mongo.NewClientWithOptions(url, opt)&lt;/p&gt;</description>
                <environment></environment>
        <key id="632940">GODRIVER-636</key>
            <summary>Add documentation on how to set a custom bsoncodec.Registry</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="5" iconUrl="https://jira.mongodb.org/images/icons/priorities/trivial.svg">Trivial - P5</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="13203">Gone away</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="tomzierbock">Tom Zierbock</reporter>
                        <labels>
                            <label>beta</label>
                    </labels>
                <created>Tue, 13 Nov 2018 09:32:57 +0000</created>
                <updated>Fri, 27 Oct 2023 20:01:32 +0000</updated>
                            <resolved>Mon, 7 Jan 2019 20:41:10 +0000</resolved>
                                                                    <component>Documentation</component>
                                        <votes>1</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="2107785" author="kris.brandow" created="Mon, 7 Jan 2019 20:40:52 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=tomzierbock&quot; class=&quot;user-hover&quot; rel=&quot;tomzierbock&quot;&gt;tomzierbock&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Given the change made in&#160;&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/pull/122&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb/mongo-go-driver/pull/122&lt;/a&gt;, I don&apos;t think we need to document this anymore. If you disagree, please reply back and we&apos;ll reopen this ticket.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;/p&gt;

&lt;p&gt;Kris&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="648363">GODRIVER-681</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hu2x4n:</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>