<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:42:05 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>[CSHARP-2269] Using condition on Linq Aggregation is not working</title>
                <link>https://jira.mongodb.org/browse/CSHARP-2269</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;I noticed this issue while doing the course on&#160;university.mongodb.com&lt;/p&gt;

&lt;p&gt;On Homework 3.1 we are requested to remove the smallest score from a list.&lt;/p&gt;

&lt;p&gt;I did this query in .net to get all the scores that are greater than the minimum:&#160;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;studentCollection.AsQueryable().Select(student =&amp;gt; new { student.Id, Scores = student.Scores.Where(sc1 =&amp;gt; sc1.Score &amp;gt; student.Scores.Min(sc2 =&amp;gt; sc2.Score)) }).ToList();&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The generated command is:&#160;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;{ &quot;aggregate&quot; : &quot;students&quot;, &quot;pipeline&quot; : &lt;a href=&quot;#d04437} &amp;quot;$gt&amp;quot; : [&amp;quot;$$sc1.score&amp;quot;, { &amp;quot;$min&amp;quot; : &amp;quot;$$sc1.scores.score&amp;quot; }]&lt;font color=&quot;&quot;&gt;&lt;/font&gt; } } }, &amp;quot;_id&amp;quot; : 0 } }&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;{ &quot;$project&quot; : { &quot;Id&quot; : &quot;$_id&quot;, &quot;Scores&quot; : { &quot;$filter&quot; : { &quot;input&quot; : &quot;$scores&quot;, &quot;as&quot; : &quot;sc1&quot;, &quot;cond&quot; : {{color:#d04437} &quot;$gt&quot; : [&quot;$$sc1.score&quot;, { &quot;$min&quot; : &quot;$$sc1.scores.score&quot; }]&lt;font color=&quot;&quot;&gt;&lt;/font&gt; } } }, &quot;_id&quot; : 0 } }&lt;/a&gt;, &quot;cursor&quot; : { }, &quot;lsid&quot; : { &quot;id&quot; : CSUUID(&quot;8cea95ec-7e89-4752-a3d4-9d7ea628cef9&quot;) } }&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;If you look closely you will notice that the $min condition is wrong, it&apos;s using&#160;&quot;&lt;em&gt;$$sc1.scores.score&lt;/em&gt;&quot; instead of&#160;&quot;&lt;em&gt;$scores.score&lt;/em&gt;&quot; ($$sc1 = $scores).&lt;/p&gt;

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

&lt;p&gt;Also I&apos;ve tried to do linked Select, but it&apos;s not supported:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;studentCollection.AsQueryable().Select(student =&amp;gt; new { student.Id, MinScore = student.Scores.Min(sc1 =&amp;gt; sc1.Score), Scores = student.Scores })&lt;br/&gt;
 .Select(student =&amp;gt; new { student.Id, Scores = student.Scores.Where(sc2 =&amp;gt; sc2.Score &amp;gt; student.MinScore) }).ToList();&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The Students collection:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;{&lt;br/&gt;
 &quot;_id&quot; : 137,&lt;br/&gt;
 &quot;name&quot; : &quot;Tamika Schildgen&quot;,&lt;br/&gt;
 &quot;scores&quot; : [&lt;br/&gt;
&#160; &#160; &#160;&lt;/p&gt;
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unknown macro: {
&#160; &#160; &#160; &amp;quot;type&amp;quot; }&lt;/span&gt; &lt;/div&gt;
&lt;p&gt;,&lt;br/&gt;
 &#160; &#160; &#160;&lt;/p&gt;
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unknown macro: {
 &#160; &#160; &#160;&amp;quot;type&amp;quot; }&lt;/span&gt; &lt;/div&gt;
&lt;p&gt;,&lt;br/&gt;
 &#160; &#160; &#160;&lt;/p&gt;
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unknown macro: {
 &#160; &#160; &#160;&amp;quot;type&amp;quot; }&lt;/span&gt; &lt;/div&gt;
&lt;p&gt; &#160; &#160; &#160;&#160; &#160; &#160;]&lt;br/&gt;
}&lt;/p&gt;&lt;/blockquote&gt;</description>
                <environment>Windows 10, Visual Studio 2017</environment>
        <key id="542609">CSHARP-2269</key>
            <summary>Using condition on Linq Aggregation is not working</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.mongodb.org/images/icons/priorities/critical.svg">Critical - P2</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="-1">Unassigned</assignee>
                                    <reporter username="liviu_rezmerita@dellteam.com">Liviu Rezmerita</reporter>
                        <labels>
                    </labels>
                <created>Fri, 11 May 2018 14:42:19 +0000</created>
                <updated>Sat, 28 Oct 2023 11:49:02 +0000</updated>
                            <resolved>Tue, 15 Feb 2022 00:12:35 +0000</resolved>
                                    <version>2.6.0</version>
                                    <fixVersion>2.14.0</fixVersion>
                                    <component>Linq</component>
                                        <votes>1</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="4354998" author="james.kovacs" created="Tue, 15 Feb 2022 00:12:35 +0000"  >&lt;p&gt;This issue has been fixed in the new LINQ provider (known as LINQ3), which is included in the 2.14 release.&lt;/p&gt;

&lt;p&gt;Configure your &lt;tt&gt;MongoClientSettings&lt;/tt&gt; to use &lt;tt&gt;LinqProvider.V3&lt;/tt&gt; if you want to use this functionality.&lt;/p&gt;

&lt;p&gt;To configure a client to use the LINQ3 provider use code like the following&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;var connectionString = &quot;mongodb://localhost&quot;;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;var clientSettings = MongoClientSettings.FromConnectionString(connectionString);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;clientSettings.LinqProvider = LinqProvider.V3;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;var client = new MongoClient(clientSettings);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                            <comment id="2881370" author="rcollette@yahoo.com" created="Mon, 17 Feb 2020 17:33:49 +0000"  >&lt;p&gt;There are only 3 critical bugs in this tracker and yet this has sat for 19 months?&#160; &#160;I guess that would be fine if this project were solely an open source endeavor but as an employee at a paying Atlas customer, I have to wonder what is going on here?&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="186587" name="students.json" size="52879" author="liviu_rezmerita@dellteam.com" created="Fri, 11 May 2018 14:47:01 +0000"/>
                    </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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>CSHARP-3615</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htowc7:</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>