<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:18:22 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-3546] Document that MONGOC_QUERY_EXHAUST does not apply to aggregate</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-3546</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;Whenever I use&#160;MONGOC_QUERY_EXHAUST with&#160;mongoc_collection_aggregate I&apos;m getting this error...&lt;/p&gt;

&lt;p&gt;mongo_read_cursor(): 5.9,&quot;unrecognized field &apos;exhaust&apos;&quot;&lt;/p&gt;</description>
                <environment>MongoDB server version: 4.2.2</environment>
        <key id="1167724">CDRIVER-3546</key>
            <summary>Document that MONGOC_QUERY_EXHAUST does not apply to aggregate</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="13201">Fixed</resolution>
                                        <assignee username="kevin.albertson@mongodb.com">Kevin Albertson</assignee>
                                    <reporter username="vdog5@mac.com">Victor Stewart</reporter>
                        <labels>
                    </labels>
                <created>Fri, 21 Feb 2020 04:18:25 +0000</created>
                <updated>Sat, 28 Oct 2023 11:28:54 +0000</updated>
                            <resolved>Mon, 2 Mar 2020 19:58:29 +0000</resolved>
                                    <version>1.16.1</version>
                                    <fixVersion>1.17.0-beta</fixVersion>
                    <fixVersion>1.17.0</fixVersion>
                                    <component>docs</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="2923622" author="xgen-internal-githook" created="Mon, 2 Mar 2020 19:58:54 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;username&apos;: &apos;kevinAlbs&apos;, &apos;name&apos;: &apos;Kevin Albertson&apos;, &apos;email&apos;: &apos;kevin.albertson@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3546&quot; title=&quot;Document that MONGOC_QUERY_EXHAUST does not apply to aggregate&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3546&quot;&gt;&lt;del&gt;CDRIVER-3546&lt;/del&gt;&lt;/a&gt; clarify MONGOC_QUERY_EXHAUST&lt;/p&gt;

&lt;p&gt;It only applies to find, not aggregate&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/01a646c548f45c35eb88beed0d919afe330aa197&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/01a646c548f45c35eb88beed0d919afe330aa197&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2899858" author="kevin.albertson" created="Sun, 23 Feb 2020 21:02:26 +0000"  >&lt;p&gt;Glad to help! And that&apos;s a good point, I&apos;ll update the docs to note to note MONGOC_QUERY_EXHAUST is not valid for aggregate.&lt;/p&gt;</comment>
                            <comment id="2899854" author="vdog5@mac.com" created="Sun, 23 Feb 2020 20:45:25 +0000"  >&lt;p&gt;Really appreciate the comprehensive response. I assumed that this was the correct behavior, but just wanted to call public note to it as this is incongruent with the documentation as it implicitly suggests that all mongoc_query_flags_t values are valid for aggregate calls. I&apos;d just suggest making a note of this exception in the documentation.&lt;/p&gt;</comment>
                            <comment id="2896136" author="kevin.albertson" created="Sat, 22 Feb 2020 16:07:31 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=vdog5%40mac.com&quot; class=&quot;user-hover&quot; rel=&quot;vdog5@mac.com&quot;&gt;vdog5@mac.com&lt;/a&gt;, exhaust cursors cannot be created for the &quot;aggregate&quot; command, only cursors created from &quot;find&quot;.&lt;/p&gt;

&lt;p&gt;I believe the error you are seeing is coming from the server. libmongoc&apos;s &lt;tt&gt;mongoc_collection_aggregate&lt;/tt&gt; parses options &lt;a href=&quot;http://mongoc.org/libmongoc/current/mongoc_collection_aggregate.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;documented here&lt;/a&gt; but sends extra options to the server as part of the &quot;aggregate&quot; command (for future-proofing).&lt;/p&gt;

&lt;p&gt;I can&apos;t find short definitive documentation to prove that &quot;aggregate&quot; does not support exhaust cursors, but here is some relevant history in case you are curious. (TL;DR though &lt;br/&gt;
 exhaust cursors only only supported on &quot;find&quot;, there are future plans to support them for &quot;aggregate&quot;).&lt;/p&gt;

&lt;p&gt;The wire protocol for &quot;find&quot; differs a bit from &quot;aggregate&quot; and has changed throughout different MongoDB server releases.&lt;/p&gt;

&lt;p&gt;In MongoDB pre 3.2, &quot;find&quot; was implemented with the &lt;a href=&quot;https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#op-query&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;OP_QUERY&lt;/a&gt; opcode. &quot;aggregate&quot; used the OP_QUERY opcode too, but as a command (i.e. though it used the OP_QUERY opcode, it used the special namespace &quot;db.$cmd&quot;, and results were returned differently). &quot;find&quot; cursors respected the exhaust flag, but command cursors did not support it.&lt;/p&gt;

&lt;p&gt;In MongoDB 3.2-3.4, &quot;find&quot; was implemented in terms of an OP_QUERY command. Drivers still supported exhaust cursors for &quot;find&quot;, but would have to downgrade to the older protocol to support it. Our &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/find_getmore_killcursors_commands.rst#exhaust&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;driver specification for the &quot;find&quot; command&lt;/a&gt; verifies this:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;The &quot;find&quot; command does not support the exhaust flag from OP_QUERY. Drivers that support exhaust MUST fallback to existing OP_QUERY wire protocol messages.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;In MongoDB 3.6, the server implemented a new unified opcode, OP_MSG. There are plans to support exhaust cursors in OP_MSG (for both &quot;find&quot; and &quot;aggregate&quot;) in&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-535&quot; title=&quot;Support Exhaust Cursor in OP_MSG&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-535&quot;&gt;&lt;del&gt;DRIVERS-535&lt;/del&gt;&lt;/a&gt;, but currently drivers still only support exhaust cursors on &quot;find&quot; via the legacy OP_QUERY protocol.&lt;/p&gt;

&lt;p&gt;As an aside, since I was curious I tried it, if you attempt to set the exhaust flag on an OP_QUERY command, a 4.2 server returns &quot;The &apos;exhaust&apos; OP_QUERY flag is invalid for commands&quot;.&lt;/p&gt;

&lt;p&gt;Best,&lt;br/&gt;
 Kevin&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="571466">DRIVERS-535</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|hwgf3r:</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>