<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:34:41 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-664] Add &apos;HasNext&apos; method to Cursor type</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-664</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;Because cursors are lazy, there&apos;s currently no way to know if the initial query fails until the first document is retrieved.&#160; The shell and some drivers offer a&#160;&#160;&lt;a href=&quot;https://docs.mongodb.com/manual/reference/method/cursor.hasNext/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;hasNext&lt;/a&gt; method on cursors that eagerly evaluates the query.&lt;/p&gt;

&lt;p&gt;There are some cases where knowing the success of a query in advance of iteration simplifies the user&apos;s code. For example, one part of the code might execute the query (and handle an error) and pass the iterator to another part for processing.&#160; Without a &lt;tt&gt;HasNext&lt;/tt&gt; type function, one has to retrieve the first document to check for error and pass the first document plus the iterator for processing.&lt;/p&gt;

&lt;p&gt;The semantics for &lt;tt&gt;HasNext&lt;/tt&gt; should be:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;If the query has not been sent, send it.&lt;/li&gt;
	&lt;li&gt;If we didn&apos;t just send the query and if the &lt;tt&gt;cursorId&lt;/tt&gt; is non-zero and if the current batch has no documents remaining, send &lt;tt&gt;getMore&lt;/tt&gt; to retrieve another batch.&lt;/li&gt;
	&lt;li&gt;If the cursor is in an error state, return false.&lt;/li&gt;
	&lt;li&gt;If there is at least one document remaining in the current batch, return true&lt;/li&gt;
	&lt;li&gt;Otherwise, return false.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;By sending only a single query or &lt;tt&gt;getMore&lt;/tt&gt;, we avoid doing more than one network roundtrip.  This is the best answer to the question &quot;what would happen if I called &lt;tt&gt;Next&lt;/tt&gt;&quot;?&lt;/p&gt;</description>
                <environment></environment>
        <key id="640340">GODRIVER-664</key>
            <summary>Add &apos;HasNext&apos; method to Cursor type</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="david.golden@mongodb.com">David Golden</reporter>
                        <labels>
                    </labels>
                <created>Thu, 29 Nov 2018 15:34:00 +0000</created>
                <updated>Mon, 3 Dec 2018 21:25:17 +0000</updated>
                            <resolved>Mon, 3 Dec 2018 21:25:17 +0000</resolved>
                                                                    <component>CRUD</component>
                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="2079161" author="ian@10gen.com" created="Mon, 3 Dec 2018 21:25:17 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=david.golden&quot; class=&quot;user-hover&quot; rel=&quot;david.golden&quot;&gt;david.golden&lt;/a&gt; and &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=kris.brandow&quot; class=&quot;user-hover&quot; rel=&quot;kris.brandow&quot;&gt;kris.brandow&lt;/a&gt; talked offline and sorted out the confusion around whether cursors are lazy or not, so closing as Won&apos;t Fix.&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|hu433j:</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>