<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:10:23 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>[CDRIVER-708] mongoc_cursor_more doesn&apos;t work as expected</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-708</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;mongoc_cursor_more returns true until mongoc_cursor_next already moved to the end of the cursor. So if I have a collection with one document, mongoc_cursor_more will still return true after I have read the document using mongoc_cursor_next. Only after mongoc_cursor_next returns false, so does mongoc_cursor_more.&lt;/p&gt;

&lt;p&gt;Here is some example code to illustrate the problem:&lt;br/&gt;
&lt;a href=&quot;http://pastebin.com/fQwX6riE&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://pastebin.com/fQwX6riE&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If I have to query mongoc_cursor_next anyway I&apos;m not sure how mongoc_cursor_more might be useful.&lt;/p&gt;</description>
                <environment></environment>
        <key id="211144">CDRIVER-708</key>
            <summary>mongoc_cursor_more doesn&apos;t work as expected</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="3">Duplicate</resolution>
                                        <assignee username="jesse@mongodb.com">A. Jesse Jiryu Davis</assignee>
                                    <reporter username="msoutier">Marius Soutier</reporter>
                        <labels>
                    </labels>
                <created>Wed, 17 Jun 2015 09:13:25 +0000</created>
                <updated>Wed, 3 May 2017 22:15:21 +0000</updated>
                            <resolved>Wed, 17 Jun 2015 13:40:58 +0000</resolved>
                                                                    <component>libmongoc</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="942893" author="jesse" created="Wed, 17 Jun 2015 13:40:58 +0000"  >&lt;p&gt;I&apos;m going to consider this a duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-516&quot; title=&quot;Clear instructions for mongoc_cursor_more&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-516&quot;&gt;&lt;del&gt;CDRIVER-516&lt;/del&gt;&lt;/a&gt;. I agree with you that mongoc_cursor_more isn&apos;t typically useful, and the C driver&apos;s documentation on the function is poor. (Other MongoDB drivers tend to have a similar cursor API, with similarly bad documentation. See &lt;a href=&quot;https://jira.mongodb.org/browse/PYTHON-660&quot; title=&quot;cursor.alive is not functioning as it should. &quot; class=&quot;issue-link&quot; data-issue-key=&quot;PYTHON-660&quot;&gt;&lt;del&gt;PYTHON-660&lt;/del&gt;&lt;/a&gt; for the exact same problem with PyMongo.)&lt;/p&gt;

&lt;p&gt;Short story: just use the return value of mongoc_cursor_next.&lt;/p&gt;

&lt;p&gt;Mid-length story: mongoc_cursor_more is unreliable because it doesn&apos;t contact the server to see if there are actually more documents in the result set. It just returns true if the cursor has not begun, or if it has begun and there are buffered documents in the client-side cursor, or if it has begun and the server hasn&apos;t yet told the cursor it&apos;s completely iterated.&lt;/p&gt;

&lt;p&gt;This is unreliable with regular queries because it&apos;s true of a new cursor before iteration, even if the cursor will match no documents. It&apos;s also true if the cursor thinks it can fetch more documents but the collection has been dropped server-side, or if the cursor has finished its final batch and the next batch &lt;b&gt;will&lt;/b&gt; be empty.&lt;/p&gt;

&lt;p&gt;mongoc_cursor_more is somewhat useful with exhaust cursors and tailable cursors, but not at all for regular cursors. Just use mongoc_cursor_next.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="180474">CDRIVER-516</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|hsae1r:</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>