<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:51:26 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-61056] N from MaxN not accepting max uint64 , likely the same for the other &quot;TopN&quot; functions</title>
                <link>https://jira.mongodb.org/browse/SERVER-61056</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;External Impact:&lt;br/&gt;
We expect user be able to provide max uint64 as N in MaxN and other function of the same family, but that returns an error.&#160; It appears we can only go up to max signed int64&lt;/p&gt;</description>
                <environment></environment>
        <key id="1911587">SERVER-61056</key>
            <summary>N from MaxN not accepting max uint64 , likely the same for the other &quot;TopN&quot; functions</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="13202">Works as Designed</resolution>
                                        <assignee username="backlog-query-execution">Backlog - Query Execution</assignee>
                                    <reporter username="steve.la@mongodb.com">Steve La</reporter>
                        <labels>
                    </labels>
                <created>Wed, 27 Oct 2021 21:52:17 +0000</created>
                <updated>Fri, 27 Oct 2023 13:52:12 +0000</updated>
                            <resolved>Thu, 28 Oct 2021 13:38:57 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                    <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1860226">SERVER-59590</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25125"><![CDATA[Query Execution]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 28 Oct 2021 13:38:47 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 15 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-1937</customfieldvalue>
                        </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>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 15 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>backlog-query-execution</customfieldvalue>
            <customfieldvalue>steve.la@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i07zlj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hzrj3r:</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>
                                                                                            <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;Repro steps&lt;/p&gt;

&lt;p&gt;Using the schema defined in the testfile&lt;/p&gt;

&lt;p&gt;jstests/aggregation/accumulators/min_n_max_n.js&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Do this&#160;&lt;/p&gt;

&lt;p&gt;coll.aggregate([ {$group: {_id: &apos;$state&apos;, maxSales: {$maxN: {output: &apos;$sales&apos;, n: NumberDecimal(&quot;18446744073709551615&quot;)}}}}, {$sort: {_id: 1}} ])&lt;br/&gt;
uncaught exception: Error: command failed: &lt;/p&gt;
{
 &quot;ok&quot; : 0,
 &quot;errmsg&quot; : &quot;PlanExecutor error during aggregation :: caused by :: Value for &apos;n&apos; must be of integral type, but found 18446744073709551615&quot;,
 &quot;code&quot; : 5787903,
 &quot;codeName&quot; : &quot;Location5787903&quot;
}
&lt;p&gt; with original command request: {&lt;br/&gt;
 &quot;aggregate&quot; : &quot;min_n_max_n&quot;,&lt;br/&gt;
 &quot;pipeline&quot; : [&lt;br/&gt;
 {&lt;br/&gt;
 &quot;$group&quot; : {&lt;br/&gt;
 &quot;_id&quot; : &quot;$state&quot;,&lt;br/&gt;
 &quot;maxSales&quot; : {&lt;br/&gt;
 &quot;$maxN&quot; : &lt;/p&gt;
{
 &quot;output&quot; : &quot;$sales&quot;,
 &quot;n&quot; : NumberDecimal(&quot;18446744073709551615&quot;)
 }
&lt;p&gt; }&lt;br/&gt;
 }&lt;br/&gt;
 },&lt;br/&gt;
 {&lt;br/&gt;
 &quot;$sort&quot; : &lt;/p&gt;
{
 &quot;_id&quot; : 1
 }
&lt;p&gt; }&lt;br/&gt;
 ],&lt;br/&gt;
 &quot;cursor&quot; : {&lt;/p&gt;

&lt;p&gt;},&lt;br/&gt;
 &quot;lsid&quot; : &lt;/p&gt;
{
 &quot;id&quot; : UUID(&quot;36f8c6e2-3d73-49e0-9729-87a97454392f&quot;)
 }
&lt;p&gt;} on connection: connection to 127.0.0.1:27017 : aggregate failed :&lt;br/&gt;
_getErrorWithCode@src/mongo/shell/utils.js:24:13&lt;br/&gt;
doassert@src/mongo/shell/assert.js:18:14&lt;br/&gt;
_assertCommandWorked@src/mongo/shell/assert.js:737:17&lt;br/&gt;
assert.commandWorked@src/mongo/shell/assert.js:829:16&lt;br/&gt;
DB.prototype._runAggregate@src/mongo/shell/db.js:280:5&lt;br/&gt;
DBCollection.prototype.aggregate@src/mongo/shell/collection.js:970:12&lt;br/&gt;
@(shell):1:1&lt;br/&gt;
&amp;gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;If I use max signed int64, I don&apos;t get the error, but if I add 1 to it, I get back the error.&lt;/p&gt;

&lt;p&gt;coll.aggregate([ {$group: {_id: &apos;$state&apos;, maxSales: {$maxN: {output: &apos;$sales&apos;, n: NumberDecimal(&quot;9223372036854775807&quot;)}}}}, {$sort: {_id: 1}} ])&lt;/p&gt;
{ &quot;_id&quot; : &quot;CA&quot;, &quot;maxSales&quot; : [ 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100 ] }
{ &quot;_id&quot; : &quot;NY&quot;, &quot;maxSales&quot; : [ 700, 600, 500, 400, 300, 200, 100 ] }
{ &quot;_id&quot; : &quot;TX&quot;, &quot;maxSales&quot; : [ 400, 300, 200, 100 ] }


&lt;p&gt;&amp;gt; coll.aggregate([ {$group: {_id: &apos;$state&apos;, maxSales: {$maxN: {output: &apos;$sales&apos;, n: NumberDecimal(&quot;9223372036854775808&quot;)}}}}, {$sort: {_id: 1}} ])&lt;br/&gt;
uncaught exception: Error: command failed: &lt;/p&gt;
{
 &quot;ok&quot; : 0,
 &quot;errmsg&quot; : &quot;PlanExecutor error during aggregation :: caused by :: Value for &apos;n&apos; must be of integral type, but found 9223372036854775808&quot;,
 &quot;code&quot; : 5787903,
 &quot;codeName&quot; : &quot;Location5787903&quot;
}
&lt;p&gt; with original command request: {&lt;br/&gt;
 &quot;aggregate&quot; : &quot;min_n_max_n&quot;,&lt;br/&gt;
 &quot;pipeline&quot; : [&lt;br/&gt;
 {&lt;br/&gt;
 &quot;$group&quot; : {&lt;br/&gt;
 &quot;_id&quot; : &quot;$state&quot;,&lt;br/&gt;
 &quot;maxSales&quot; : {&lt;br/&gt;
 &quot;$maxN&quot; : &lt;/p&gt;
{
 &quot;output&quot; : &quot;$sales&quot;,
 &quot;n&quot; : NumberDecimal(&quot;9223372036854775808&quot;)
 }
&lt;p&gt; }&lt;br/&gt;
 }&lt;br/&gt;
 },&lt;br/&gt;
 {&lt;br/&gt;
 &quot;$sort&quot; : &lt;/p&gt;
{
 &quot;_id&quot; : 1
 }
&lt;p&gt; }&lt;br/&gt;
 ],&lt;br/&gt;
 &quot;cursor&quot; : {&lt;/p&gt;

&lt;p&gt;},&lt;br/&gt;
 &quot;lsid&quot; : &lt;/p&gt;
{
 &quot;id&quot; : UUID(&quot;36f8c6e2-3d73-49e0-9729-87a97454392f&quot;)
 }
&lt;p&gt;} on connection: connection to 127.0.0.1:27017 : aggregate failed :&lt;br/&gt;
_getErrorWithCode@src/mongo/shell/utils.js:24:13&lt;br/&gt;
doassert@src/mongo/shell/assert.js:18:14&lt;br/&gt;
_assertCommandWorked@src/mongo/shell/assert.js:737:17&lt;br/&gt;
assert.commandWorked@src/mongo/shell/assert.js:829:16&lt;br/&gt;
DB.prototype._runAggregate@src/mongo/shell/db.js:280:5&lt;br/&gt;
DBCollection.prototype.aggregate@src/mongo/shell/collection.js:970:12&lt;br/&gt;
@(shell):1:1&lt;br/&gt;
&amp;gt;&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_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i07lqv:</customfieldvalue>

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