<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:20:59 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-205] Specify that a batch size of 1 is translated to 2</title>
                <link>https://jira.mongodb.org/browse/DRIVERS-205</link>
                <project id="10980" key="DRIVERS">Drivers</project>
                    <description>&lt;p&gt;If the user specifies a batch size of 1, the driver must use a batch size of 2 for the initial query, because the server treats nToReturn of 1 in OP_QUERY the same as -1: it closes the cursor after the first batch.&lt;/p&gt;

&lt;p&gt;In PyMongo we override batch size of 1 with 2, not just for OP_QUERY but for OP_GET_MORE too.&lt;/p&gt;

&lt;p&gt;Let us specify that drivers use batch size 2 instead of 1 for OP_QUERY only, not for OP_GET_MORE.&lt;/p&gt;

&lt;p&gt;Let us also discover the history and intent of the server&apos;s quirky OP_QUERY behavior, and investigate whether the &quot;find&quot; command will act the same.&lt;/p&gt;</description>
                <environment></environment>
        <key id="185665">DRIVERS-205</key>
            <summary>Specify that a batch size of 1 is translated to 2</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</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="jesse@mongodb.com">A. Jesse Jiryu Davis</reporter>
                        <labels>
                    </labels>
                <created>Mon, 23 Feb 2015 15:50:20 +0000</created>
                <updated>Mon, 15 Apr 2019 17:28:51 +0000</updated>
                            <resolved>Fri, 30 Oct 2015 19:30:47 +0000</resolved>
                                                                            <votes>0</votes>
                                    <watches>11</watches>
                                                                                                                <comments>
                            <comment id="924879" author="jesse" created="Wed, 27 May 2015 17:18:05 +0000"  >&lt;p&gt;Understood, maybe this isn&apos;t worth doing after all.&lt;/p&gt;</comment>
                            <comment id="924365" author="derick" created="Wed, 27 May 2015 09:01:26 +0000"  >&lt;p&gt;Hmm, I don&apos;t know whether I would like to change this for the legacy PHP driver. It&apos;s technically a BC break. For PHPC, and HHVM, this would work as it&apos;s new.&lt;/p&gt;</comment>
                            <comment id="876612" author="jesse" created="Thu, 9 Apr 2015 02:42:25 +0000"  >&lt;p&gt;Except, at least for the initial query, we can&apos;t set batch size to 1, since the server interprets it as -1 and ends the query.&lt;/p&gt;</comment>
                            <comment id="876588" author="behackett" created="Thu, 9 Apr 2015 02:01:19 +0000"  >&lt;p&gt;Setting a batch size of one is actually useful for finding corrupt / invalid documents. Since drivers generally decode a batch at a time it&apos;s often difficult to figure out which document caused the decoder to raise an error.&lt;/p&gt;</comment>
                            <comment id="841945" author="jesse" created="Tue, 3 Mar 2015 18:54:41 +0000"  >&lt;p&gt;There will be a weird breaking change in PHP, at least, when it upgrades to the &quot;find&quot; command and a batch size of 1 returns a cursor that can be iterated past the first document. I hope it is very rare, since someone who actually wants one document should say &quot;findOne&quot;. Setting a tiny batch size in general ought to be very rare since it&apos;s so inefficient.&lt;/p&gt;</comment>
                            <comment id="834896" author="rassi@10gen.com" created="Mon, 23 Feb 2015 17:01:11 +0000"  >&lt;p&gt;To clarify: a batch size of 1 will indeed be supported in the find and getmore commands.  It&apos;s not clear yet to me whether or not a batch size of 0 will be supported.&lt;/p&gt;</comment>
                            <comment id="834836" author="david.storch" created="Mon, 23 Feb 2015 16:12:40 +0000"  >&lt;p&gt;This will only be relevant for &quot;legacy style&quot; find and getmore. The find command has three fields for the information which used to be collapsed into the &lt;tt&gt;ntoreturn&lt;/tt&gt; field: &lt;tt&gt;limit&lt;/tt&gt;, &lt;tt&gt;batchSize&lt;/tt&gt;, and the boolean field &lt;tt&gt;singleBatch&lt;/tt&gt;.&lt;/p&gt;</comment>
                            <comment id="834821" author="jesse" created="Mon, 23 Feb 2015 15:52:35 +0000"  >&lt;p&gt;FYI &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=david.storch&quot; class=&quot;user-hover&quot; rel=&quot;david.storch&quot;&gt;david.storch&lt;/a&gt; &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=rassi%4010gen.com&quot; class=&quot;user-hover&quot; rel=&quot;rassi@10gen.com&quot;&gt;rassi@10gen.com&lt;/a&gt;, relevant to the &quot;find&quot; and &quot;getmore&quot; commands.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="227918">JAVA-1946</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|hs6iun:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>163417</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>