<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:38:09 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-34879] $let in the $lookup pipeline only allows variable names with lower cases</title>
                <link>https://jira.mongodb.org/browse/SERVER-34879</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;In the mongodb document:&lt;/p&gt;

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

&lt;p&gt;&lt;a href=&quot;https://docs.mongodb.com/master/reference/operator/aggregation/lookup/index.html#lookup-uncorrelated-subuery&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://docs.mongodb.com/master/reference/operator/aggregation/lookup/index.html#lookup-uncorrelated-subuery&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;The example query:&lt;/p&gt;

&lt;p&gt;db.orders.aggregate([&lt;br/&gt;
 {&lt;br/&gt;
 $lookup:&lt;br/&gt;
 &lt;/p&gt;
{
 from: &quot;warehouses&quot;,
 let: \{ order_item: &quot;$item&quot;, order_qty: &quot;$ordered&quot; }
&lt;p&gt;,&lt;br/&gt;
 pipeline: [&lt;br/&gt;
 { $match:&lt;br/&gt;
 { $expr:&lt;br/&gt;
 &lt;/p&gt;
{ $and:
 [
 \{ $eq: [ &quot;$stock_item&quot;, &quot;$$order_item&quot; ] }
&lt;p&gt;,&lt;br/&gt;
 { $gte: [ &quot;$instock&quot;, &quot;$$order_qty&quot; ] }&lt;br/&gt;
 ]&lt;br/&gt;
 }&lt;br/&gt;
 }&lt;br/&gt;
 },&lt;br/&gt;
 { $project: &lt;/p&gt;
{ stock_item: 0, _id: 0 }
&lt;p&gt; }&lt;br/&gt;
 ],&lt;br/&gt;
 as: &quot;stockdata&quot;&lt;br/&gt;
 }&lt;br/&gt;
 }&lt;br/&gt;
])&lt;/p&gt;

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

&lt;p&gt;This runs fine, but if the line:&lt;/p&gt;

&lt;p&gt;let: { order_item: &quot;$item&quot;, order_qty: &quot;$ordered&quot; },&lt;/p&gt;

&lt;p&gt;is replaced by:&lt;/p&gt;

&lt;p&gt;let: { ORDER_ITEM: &quot;$item&quot;, ORDER_QTY: &quot;$ordered&quot; },&lt;/p&gt;

&lt;p&gt;and replace these variables in the other two lines:&lt;/p&gt;

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

{ $eq: [ &quot;$stock_item&quot;, &quot;$$ORDER_ITEM&quot; ] }
&lt;p&gt;,&lt;br/&gt;
 { $gte: [ &quot;$instock&quot;, &quot;$$ORDER_QTY&quot; ] }&lt;/p&gt;

&lt;p&gt;The mongo shell returns error:&lt;/p&gt;

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

&lt;p&gt;assert: command failed: &lt;/p&gt;
{

&quot;ok&quot; : 0,

&quot;errmsg&quot; : &quot;&apos;ORDER_ITEM&apos; starts with an invalid character for a user variable name&quot;,

&quot;code&quot; : 16867,

&quot;codeName&quot; : &quot;Location16867&quot;

}
&lt;p&gt; : aggregate failed&lt;/p&gt;

&lt;p&gt;_getErrorWithCode@src/mongo/shell/utils.js:25:13&lt;/p&gt;

&lt;p&gt;doassert@src/mongo/shell/assert.js:16:14&lt;/p&gt;

&lt;p&gt;assert.commandWorked@src/mongo/shell/assert.js:403:5&lt;/p&gt;

&lt;p&gt;DB.prototype._runAggregate@src/mongo/shell/db.js:260:9&lt;/p&gt;

&lt;p&gt;DBCollection.prototype.aggregate@src/mongo/shell/collection.js:1212:12&lt;/p&gt;

&lt;p&gt;@(shell):1:1&lt;/p&gt;

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

&lt;p&gt;2018-05-07T18:11:21.195-0400 E QUERY&#160; &#160; &lt;span class=&quot;error&quot;&gt;&amp;#91;thread1&amp;#93;&lt;/span&gt; Error: command failed: &lt;/p&gt;
{

&quot;ok&quot; : 0,

&quot;errmsg&quot; : &quot;&apos;ORDER_ITEM&apos; starts with an invalid character for a user variable name&quot;,

&quot;code&quot; : 16867,

&quot;codeName&quot; : &quot;Location16867&quot;

}
&lt;p&gt; : aggregate failed :&lt;/p&gt;

&lt;p&gt;_getErrorWithCode@src/mongo/shell/utils.js:25:13&lt;/p&gt;

&lt;p&gt;doassert@src/mongo/shell/assert.js:16:14&lt;/p&gt;

&lt;p&gt;assert.commandWorked@src/mongo/shell/assert.js:403:5&lt;/p&gt;

&lt;p&gt;DB.prototype._runAggregate@src/mongo/shell/db.js:260:9&lt;/p&gt;

&lt;p&gt;DBCollection.prototype.aggregate@src/mongo/shell/collection.js:1212:12&lt;/p&gt;

&lt;p&gt;@(shell):1:1&lt;/p&gt;

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

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

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="540562">SERVER-34879</key>
            <summary>$let in the $lookup pipeline only allows variable names with lower cases</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="13202">Works as Designed</resolution>
                                        <assignee username="schwerin@mongodb.com">Andy Schwerin</assignee>
                                    <reporter username="jliuecmd@yahoo.com">Jun Liu</reporter>
                        <labels>
                    </labels>
                <created>Mon, 7 May 2018 22:14:19 +0000</created>
                <updated>Fri, 27 Oct 2023 13:53:48 +0000</updated>
                            <resolved>Tue, 8 May 2018 03:31:39 +0000</resolved>
                                    <version>3.6.1</version>
                                                    <component>Aggregation Framework</component>
                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="1885444" author="schwerin" created="Tue, 8 May 2018 03:30:50 +0000"  >&lt;p&gt;Per the documentation on &lt;a href=&quot;https://docs.mongodb.com/manual/reference/aggregation-variables/#user-variables&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;user variables in aggregation pipelines&lt;/a&gt;, user defined variables must start with a lower case letters a-z or with non-ascii characters.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 8 May 2018 03:30:50 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        5 years, 40 weeks, 2 days 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>false</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>
                            5 years, 40 weeks, 2 days 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>schwerin@mongodb.com</customfieldvalue>
            <customfieldvalue>jliuecmd@yahoo.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htxhmn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htoitb:</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_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|htx3vz:</customfieldvalue>

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