<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:20:44 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>[DRIVERS-83] Support the Exhaust flag on query</title>
                <link>https://jira.mongodb.org/browse/DRIVERS-83</link>
                <project id="10980" key="DRIVERS">Drivers</project>
                    <description>&lt;p&gt;There are two ways to resolve this ticket for a given driver: &lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Raise an exception / set an error state in your driver if the user tries to set the exhaust flag or just make the flag impossible to set. &lt;b&gt;This is probably what you want to do.&lt;/b&gt;&lt;/li&gt;
	&lt;li&gt;Implement support for the flag in your driver. Keep reading for details...&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;There are several drivers that specify the Exhaust flag for queries but don&apos;t actually support it properly if set. There are several things you have to ensure to support exhaust: &lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Cursor still needs to handle the equivalent of the initial query response and one or more subsequent responses. However, actual getMore messages are not sent to the server. You just receive off the same socket again.&lt;/li&gt;
	&lt;li&gt;The responses to these implicit &quot;getMores&quot; all must be read from the same socket, not just the same server.&lt;/li&gt;
	&lt;li&gt;If the user doesn&apos;t iterate through all the results, the driver &lt;b&gt;must&lt;/b&gt; either close the socket or drain the socket of the remaining getMore response. Otherwise, the next time the socket is read from, you&apos;ll be reading the wrong thing. You can tell when you&apos;re done because the last message will have cursorId = 0.&lt;/li&gt;
	&lt;li&gt;mongos does not support the exhaust flag. Furthermore, it does not raise an error if the exhaust flag is set. Your driver will just hang trying to read the second response. You &lt;b&gt;must&lt;/b&gt; raise an error if the user tries to use exhaust when connected to mongos.&lt;/li&gt;
	&lt;li&gt;When iterating the exhaust cursor, the response id returned for each batch is equivalent to the request id the &lt;b&gt;server&lt;/b&gt; returned with the previous batch.&lt;/li&gt;
	&lt;li&gt;Exhaust and limit are incompatible. Limit is a client side concept that requires altering &quot;ntoreturn&quot; in each getMore call and sending a kill cursors command to the server when you have received &quot;limit&quot; number of documents. Since exhaust cursors don&apos;t use getMore calls and don&apos;t support kill cursors, there is no sane way to support limit. Your driver should raise an error if exhaust and limit are specified together.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Note also that like any query, the total number of documents returned can be arbitrarily large, so care should be taken to only require memory proportional to each chunk.&lt;/p&gt;

&lt;p&gt;If the driver does not support the exhaust flag properly, but does support setting the query flags, it should at minimum throw an exception if the Exhaust flag is set by the user, since otherwise the errors you get are hard to diagnose.&lt;/p&gt;</description>
                <environment></environment>
        <key id="72015">DRIVERS-83</key>
            <summary>Support the Exhaust flag on query</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="9">Done</resolution>
                                        <assignee username="barrie">Barrie Segal</assignee>
                                    <reporter username="jeff.yemin@mongodb.com">Jeffrey Yemin</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Apr 2013 21:53:55 +0000</created>
                <updated>Mon, 15 Apr 2019 17:29:49 +0000</updated>
                            <resolved>Thu, 29 Sep 2016 20:00:20 +0000</resolved>
                                                                            <votes>0</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="1674367" author="jmikola@gmail.com" created="Fri, 15 Sep 2017 19:30:15 +0000"  >&lt;p&gt;Implemented by &lt;a href=&quot;https://jira.mongodb.org/browse/PHPC-156&quot; title=&quot;Support Exhaust query option&quot; class=&quot;issue-link&quot; data-issue-key=&quot;PHPC-156&quot;&gt;&lt;del&gt;PHPC-156&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;PHPLIB supports this via the deprecated modifiers document option for &lt;tt&gt;Collection::find()&lt;/tt&gt;; however, it will not support a top-level &lt;tt&gt;exhaust&lt;/tt&gt; option since it is not defined in the CRUD spec.&lt;/p&gt;</comment>
                            <comment id="841829" author="acm" created="Tue, 3 Mar 2015 17:50:45 +0000"  >&lt;p&gt;Validating for C&amp;#43;&amp;#43;11 since validated for C, also because C&amp;#43;&amp;#43;11 API implements CRUD spec.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="93072">CDRIVER-242</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="83896">RUBY-650</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="86302">RUBY-679</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="20632">PYTHON-265</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="72010">CSHARP-726</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="72021">JAVA-808</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="71865">PHPC-156</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="14892">SERVER-2627</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_23952" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Driver Compliance</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<style type='text/css'>
         #scriptField, #scriptField *{
                border: 1px solid black;
            }

            #scriptField{
                border-collapse: collapse;
            }

            #scriptField td {
                text-align: center; /* Center-align text in table cells */
            }

            #scriptField td.key {
                text-align: left; /* Left-align text in the Key column */
            }

            #scriptField a {
                text-decoration: none; /* Remove underlines from links */
                border: none; /* Remove border from links */
            }
            
            /* Add green background color to cells with FixVersion */
            #scriptField td.hasFixVersion {
                background-color: #00FF00; /* Green color code */
            }

            /* Center-align the first row headers */
            #scriptField th {
                text-align: center;
            }
        </style>
<table id='scriptField'>
  <tr>
    <th>Key</th>
    <th>Status/Resolution</th>
    <th>FixVersion</th>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/PYTHON-265'>PYTHON-265</a>
    </td>
    <td>Done</td>
    <td class='hasFixVersion'>2.6</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/JAVA-808'>JAVA-808</a>
    </td>
    <td>Won't Fix</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/CSHARP-726'>CSHARP-726</a>
    </td>
    <td>Won't Fix</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/PHPC-156'>PHPC-156</a>
    </td>
    <td>Done</td>
    <td class='hasFixVersion'>1.2.0-alpha3, 1.2.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/RUBY-650'>RUBY-650</a>
    </td>
    <td>Done</td>
    <td class='hasFixVersion'>1.9.2</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/RUBY-679'>RUBY-679</a>
    </td>
    <td>Done</td>
    <td class='hasFixVersion'>1.9.2</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/PERL-282'>PERL-282</a>
    </td>
    <td>Won't Fix</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/CDRIVER-242'>CDRIVER-242</a>
    </td>
    <td>Done</td>
    <td class='hasFixVersion'>0.90.0</td>
  </tr>
</table>]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrnbbz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>49785</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_11150" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>SERVER fixVersion</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10942"><![CDATA[2.6]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    </customfields>
    </item>
</channel>
</rss>