<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:34:17 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-474] Expose Cursor.Peek() function to know how much space a document will require</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-474</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;It would be convenient to expose a Peek function for Cursor, so that, if one is interested in allocating a byte slice to accommodate the Decode(), they can do it. Otherwise, we have to guess-timate the size of the byte slice to pass to Decode, or look for NewErrTooSmall errors, which is not optimal.&lt;/p&gt;

&lt;p&gt;relevant code:&#160;&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/blob/2bc72ab2a7bf23f6f53554e9cf48b061943d664e/bson/decode.go#L181-L197&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/blob/2bc72ab2a7bf23f6f53554e9cf48b061943d664e/bson/decode.go#L181-L197&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="562273">GODRIVER-474</key>
            <summary>Expose Cursor.Peek() function to know how much space a document will require</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="gpean">Gregoire Pean</reporter>
                        <labels>
                    </labels>
                <created>Wed, 20 Jun 2018 23:09:16 +0000</created>
                <updated>Mon, 10 Sep 2018 20:32:50 +0000</updated>
                            <resolved>Mon, 10 Sep 2018 20:32:50 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1998642" author="kris.brandow" created="Mon, 10 Sep 2018 20:32:50 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=gpean&quot; class=&quot;user-hover&quot; rel=&quot;gpean&quot;&gt;gpean&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Since we&apos;re going to add support for appending the document to a slice of bytes via &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-475&quot; title=&quot;Add to Cursor a way to append document bytes to a slice&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-475&quot;&gt;&lt;del&gt;GODRIVER-475&lt;/del&gt;&lt;/a&gt;. We feel like this is a more robust solution than attempting to providing the raw bytes returned from the server.&lt;/p&gt;

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

&lt;p&gt;Kris&lt;/p&gt;</comment>
                            <comment id="1927702" author="gpean" created="Thu, 21 Jun 2018 15:54:11 +0000"  >&lt;p&gt;Hi Kris,&lt;/p&gt;

&lt;p&gt;Here I&apos;m really looking to stream the whole binary/bson response as the HTTP response, so that the browser can consume it directly, and so that we avoid unnecessary conversions. In addition to reworking and/or documenting the DecodeBytes, do you think you could add support for getting (more importantly, streaming) the whole &lt;em&gt;array of documents&lt;/em&gt; as BSON?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                            <comment id="1927545" author="kris.brandow" created="Thu, 21 Jun 2018 15:06:44 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=gpean&quot; class=&quot;user-hover&quot; rel=&quot;gpean&quot;&gt;gpean&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;I was going to ask about the &lt;tt&gt;DecodeBytes&lt;/tt&gt; function. I think we still need to document it, but the bytes from &lt;tt&gt;DecodeBytes&lt;/tt&gt; should be copied, since they are the bytes we received from the server, so keeping it around could potentially keep a large slice of memory allocated.&lt;/p&gt;

&lt;p&gt;--Kris&lt;/p&gt;</comment>
                            <comment id="1926935" author="gpean" created="Thu, 21 Jun 2018 00:09:07 +0000"  >&lt;p&gt;Nevermind, I think what I&apos;m asking does not make sense / is unneeded given there is DecodeBytes() available&lt;/p&gt;</comment>
                            <comment id="1926931" author="gpean" created="Thu, 21 Jun 2018 00:00:39 +0000"  >&lt;p&gt;By Peek() I really meant PeakLength()&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="562526">GODRIVER-475</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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htrx9b:</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>