<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:38:12 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-922] LINQ queries with coll.Any() can be improved to avoid $elemMatch.</title>
                <link>https://jira.mongodb.org/browse/CSHARP-922</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;Presently any query of the form:&lt;/p&gt;

&lt;p&gt;coll.Where(c =&amp;gt; c.Array.Any(a =&amp;gt; a.value == val))&lt;/p&gt;

&lt;p&gt;maps to the database as something like:&lt;/p&gt;

&lt;p&gt;db.Coll.find({ &quot;Array&quot; : { &quot;$elemMatch&quot; : &lt;/p&gt;
{&quot;Value&quot; : val }
&lt;p&gt; } } )&lt;/p&gt;

&lt;p&gt;A faster query which is entirely acheivable in the C# driver is:&lt;/p&gt;

&lt;p&gt;db.Coll.find(&lt;/p&gt;
{ &quot;Array.Value&quot; : val  }
&lt;p&gt; )&lt;/p&gt;

&lt;p&gt;For example, this query:&lt;/p&gt;

&lt;p&gt;books.Where(b =&amp;gt; b.Ratings.Any(r =&amp;gt; r.Value &amp;gt;= 0))&lt;/p&gt;

&lt;p&gt;becomes:&lt;/p&gt;

&lt;p&gt;db.Book.find({ &quot;Ratings&quot; : { &quot;$elemMatch&quot; : {&quot;Value&quot; : &lt;/p&gt;
{ &quot;$gte&quot; : 0 }
&lt;p&gt; } } } )&lt;/p&gt;

&lt;p&gt;It should be&lt;/p&gt;

&lt;p&gt;db.Book.find({ &quot;Ratings.Value&quot;: &lt;/p&gt;
{ &quot;$gte&quot; : 0 }
&lt;p&gt;  } )&lt;/p&gt;</description>
                <environment></environment>
        <key id="118005">CSHARP-922</key>
            <summary>LINQ queries with coll.Any() can be improved to avoid $elemMatch.</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="9">Done</resolution>
                                        <assignee username="craig.wilson@mongodb.com">Craig Wilson</assignee>
                                    <reporter username="mkennedy66996693">Michael Kennedy</reporter>
                        <labels>
                    </labels>
                <created>Wed, 5 Mar 2014 22:31:57 +0000</created>
                <updated>Wed, 20 Jan 2016 20:09:50 +0000</updated>
                            <resolved>Fri, 8 May 2015 13:20:46 +0000</resolved>
                                    <version>1.8.3</version>
                                    <fixVersion>2.1</fixVersion>
                                    <component>Linq</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="908585" author="xgen-internal-githook" created="Fri, 8 May 2015 13:20:22 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;craiggwilson&apos;, u&apos;name&apos;: u&apos;Craig Wilson&apos;, u&apos;email&apos;: u&apos;craiggwilson@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-922&quot; title=&quot;LINQ queries with coll.Any() can be improved to avoid $elemMatch.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-922&quot;&gt;&lt;del&gt;CSHARP-922&lt;/del&gt;&lt;/a&gt;: single condition Any calls in LINQ no longer use $elemMatch.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/commit/74c463443ca04e0d39cbc1deacbb59a638972fc0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/commit/74c463443ca04e0d39cbc1deacbb59a638972fc0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="510356" author="mkennedy66996693" created="Wed, 5 Mar 2014 23:02:45 +0000"  >&lt;p&gt;Sorry I forgot to add this when I submitted:&lt;/p&gt;

&lt;p&gt;I tested this both on 2.4.9 and 2.6.0_rc0.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></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>CSHARP-935</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hs7usf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>103720</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="506">C# Sprint 19</customfieldvalue>

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