<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:31:52 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>[SERVER-13486] The geoNear command can create too large BSON objects</title>
                <link>https://jira.mongodb.org/browse/SERVER-13486</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;div class=&quot;panel&quot; style=&quot;background-color: #EEEEEE;border-color: #ccc;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-color: #ccc;background-color: #6CB33F;&quot;&gt;&lt;b&gt;Issue Status as of April 15, 2014&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;panelContent&quot; style=&quot;background-color: #EEEEEE;&quot;&gt;
&lt;p&gt;&lt;b&gt;ISSUE SUMMARY&lt;/b&gt;&lt;br/&gt;
The &lt;a href=&quot;http://docs.mongodb.org/manual/reference/command/geoNear/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;geoNear&lt;/tt&gt;&lt;/a&gt; command does not check if the BSON size limit is reached when assembling the result array.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;USER IMPACT&lt;/b&gt;&lt;br/&gt;
Results from &lt;tt&gt;geoNear&lt;/tt&gt; that are larger than the BSON size (16MB) cause an exception and abort the command.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;WORKAROUNDS&lt;/b&gt;&lt;br/&gt;
Query for a smaller result set, for example with a smaller &lt;tt&gt;maxDistance&lt;/tt&gt; value.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;RESOLUTION&lt;/b&gt;&lt;br/&gt;
The &lt;tt&gt;geoNear&lt;/tt&gt; command now detects when it reaches the BSON size and will truncate the result set. A warning is logged that the command tried to return a larger result.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;AFFECTED VERSIONS&lt;/b&gt;&lt;br/&gt;
Version 2.6.0 is affected by this bug.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;PATCHES&lt;/b&gt;&lt;br/&gt;
The patch is included in the 2.6.1 production release.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;h6&gt;&lt;a name=&quot;Originaldescription&quot;&gt;&lt;/a&gt;Original description&lt;/h6&gt;

&lt;p&gt;The new aggregation framework on 2.6.0 returns a cursor, so its output should be unlimited.&lt;br/&gt;
However if one performs an aggregation query with $geonear it looks like the output is still limited to 16MB.&lt;/p&gt;

&lt;p&gt;&amp;gt; db.testData.aggregate([{$geoNear: {near : &lt;/p&gt;
{ type : &quot;Point&quot; , coordinates: [50,50] }
&lt;p&gt; , distanceField:&quot;dist&quot;,spherical : true,  maxDistance : (10000000), num:200000 }}])&lt;br/&gt;
assert: command failed: {&lt;br/&gt;
	&quot;errmsg&quot; : &quot;exception: nextSafe(): &lt;/p&gt;
{ $err: \&quot;BSONObj size: 23689189 (0x16977E5) is invalid. Size must be between 0 and 16793600(16MB)\&quot;, code: 10334 }
&lt;p&gt;&quot;,&lt;br/&gt;
	&quot;code&quot; : 13106,&lt;br/&gt;
	&quot;ok&quot; : 0&lt;br/&gt;
} : aggregate failed&lt;br/&gt;
Error: command failed: {&lt;br/&gt;
	&quot;errmsg&quot; : &quot;exception: nextSafe(): &lt;/p&gt;
{ $err: \&quot;BSONObj size: 23689189 (0x16977E5) is invalid. Size must be between 0 and 16793600(16MB)\&quot;, code: 10334 }
&lt;p&gt;&quot;,&lt;br/&gt;
	&quot;code&quot; : 13106,&lt;br/&gt;
	&quot;ok&quot; : 0&lt;br/&gt;
} : aggregate failed&lt;br/&gt;
    at Error (&amp;lt;anonymous&amp;gt;)&lt;br/&gt;
    at doassert (src/mongo/shell/assert.js:11:14)&lt;br/&gt;
    at Function.assert.commandWorked (src/mongo/shell/assert.js:244:5)&lt;br/&gt;
    at DBCollection.aggregate (src/mongo/shell/collection.js:1149:12)&lt;br/&gt;
    at (shell):1:13&lt;br/&gt;
2014-04-04T11:17:26.395+0200 Error: command failed: {&lt;br/&gt;
	&quot;errmsg&quot; : &quot;exception: nextSafe(): &lt;/p&gt;
{ $err: \&quot;BSONObj size: 23689189 (0x16977E5) is invalid. Size must be between 0 and 16793600(16MB)\&quot;, code: 10334 }
&lt;p&gt;&quot;,&lt;br/&gt;
	&quot;code&quot; : 13106,&lt;br/&gt;
	&quot;ok&quot; : 0&lt;br/&gt;
} : aggregate failed at src/mongo/shell/assert.js:13&lt;/p&gt;</description>
                <environment></environment>
        <key id="129373">SERVER-13486</key>
            <summary>The geoNear command can create too large BSON objects</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="9">Done</resolution>
                                        <assignee username="hari.khalsa@10gen.com">hari.khalsa@10gen.com</assignee>
                                    <reporter username="sesshoumaru80">giuliano giuffrida</reporter>
                        <labels>
                    </labels>
                <created>Fri, 4 Apr 2014 09:19:51 +0000</created>
                <updated>Mon, 11 Jul 2016 17:16:44 +0000</updated>
                            <resolved>Wed, 9 Apr 2014 14:34:46 +0000</resolved>
                                    <version>2.6.0-rc1</version>
                    <version>2.6.0-rc2</version>
                                    <fixVersion>2.6.1</fixVersion>
                    <fixVersion>2.7.0</fixVersion>
                                    <component>Aggregation Framework</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="560733" author="sesshoumaru80" created="Wed, 23 Apr 2014 19:43:45 +0000"  >&lt;p&gt;&quot;The geoNear command does not check if the BSON size limit is reached when assembling the result array.&quot;&lt;/p&gt;

&lt;p&gt;I don&apos;t understand: why a &quot;result array&quot; and not a cursor ?&lt;br/&gt;
It looks like aggregation queries with geoNear are different from other aggregation queries, is that the case ?&lt;/p&gt;
</comment>
                            <comment id="543016" author="xgen-internal-githook" created="Wed, 9 Apr 2014 23:00:42 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;hkhalsa&apos;, u&apos;name&apos;: u&apos;Hari Khalsa&apos;, u&apos;email&apos;: u&apos;hkhalsa@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-13486&quot; title=&quot;The geoNear command can create too large BSON objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-13486&quot;&gt;&lt;del&gt;SERVER-13486&lt;/del&gt;&lt;/a&gt; check obj size when building return of geonear cmd&lt;/p&gt;

&lt;p&gt;(cherry picked from commit b4a2cc96b18cacdfece81215d9d8c7a3a84ba20a)&lt;br/&gt;
Branch: v2.6&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/ac55e3f5a963f8ed2b0516703f8305e8091595f0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/ac55e3f5a963f8ed2b0516703f8305e8091595f0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="541016" author="xgen-internal-githook" created="Tue, 8 Apr 2014 17:24:54 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;hkhalsa&apos;, u&apos;name&apos;: u&apos;Hari Khalsa&apos;, u&apos;email&apos;: u&apos;hkhalsa@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-13486&quot; title=&quot;The geoNear command can create too large BSON objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-13486&quot;&gt;&lt;del&gt;SERVER-13486&lt;/del&gt;&lt;/a&gt; check obj size when building return of geonear cmd&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/b4a2cc96b18cacdfece81215d9d8c7a3a84ba20a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/b4a2cc96b18cacdfece81215d9d8c7a3a84ba20a&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12451" key="com.atlassian.jira.plugin.system.customfieldtypes:multiversion">
                        <customfieldname>Backport Completed</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="13794">2.6.1</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 8 Apr 2014 17:24:54 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        9 years, 43 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            9 years, 43 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>sesshoumaru80</customfieldvalue>
            <customfieldvalue>hari.khalsa@10gen.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrlxef:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>110841</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;for (var i = 1; i &amp;lt;= 200000; i++) db.testData.insert( { loc  : &lt;/p&gt;
{type:&quot;Point&quot;, coordinates:[90*(i/200000),90*(i/200000)]}
&lt;p&gt; } )&lt;/p&gt;

&lt;p&gt;db.testData.ensureIndex(&lt;/p&gt;
{loc : &quot;2dsphere&quot;}
&lt;p&gt;)&lt;/p&gt;

&lt;p&gt;db.testData.aggregate([{$geoNear: {near : &lt;/p&gt;
{ type : &quot;Point&quot; , coordinates: [50,50] }
&lt;p&gt; , distanceField:&quot;dist&quot;,spherical : true,  maxDistance : (10000000), num:200000 }}])&lt;/p&gt;</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11861" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>User Summary</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="11858"><![CDATA[Completed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrja67:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>