<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:44:19 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-3083] Linq Driver Performing pipeline instead of find on query</title>
                <link>https://jira.mongodb.org/browse/CSHARP-3083</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;Reporting this as a bug BUT i would have expected the linq query to generate the same qeury under the covers as the find query.&#160; Instead the linq query is generating an aggregation pipeline.&lt;/p&gt;

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

&lt;p&gt;```&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; var document = GetCollection&amp;lt;MediaDocument&amp;gt;()&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; .Find(x =&amp;gt; x.ImageUniqueIdentifier == imageUniqueIdentifier)&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; .FirstOrDefault();&lt;/p&gt;

&lt;p&gt;```&lt;/p&gt;

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

&lt;p&gt;```&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; &#160; &#160; var document = GetCollection&amp;lt;MediaDocument&amp;gt;()&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; .AsQueryable()&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; .Where(x =&amp;gt; x.ImageUniqueIdentifier == imageUniqueIdentifier)&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; .FirstOrDefault();&lt;/p&gt;

&lt;p&gt;```&lt;/p&gt;</description>
                <environment></environment>
        <key id="1333252">CSHARP-3083</key>
            <summary>Linq Driver Performing pipeline instead of find on query</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="-1">Unassigned</assignee>
                                    <reporter username="michael_fyffe@homedepot.com">Michael Fyffe</reporter>
                        <labels>
                    </labels>
                <created>Wed, 29 Apr 2020 20:12:52 +0000</created>
                <updated>Fri, 27 Oct 2023 13:24:51 +0000</updated>
                            <resolved>Wed, 29 Apr 2020 20:27:42 +0000</resolved>
                                    <version>2.10.3</version>
                                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="3061608" author="michael_fyffe@homedepot.com" created="Wed, 29 Apr 2020 23:17:54 +0000"  >&lt;p&gt;Hey DMitry,&lt;/p&gt;

&lt;p&gt;Are you sure there is no performance difference?&#160; Under the covers mongodb is taking a completely different path for execution ( find vs aggregation pipeline ).&#160; Do you happen to have documentation discussing this that i can take a peek at!&lt;/p&gt;

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

&lt;p&gt;Thanks for the help!!&lt;/p&gt;</comment>
                            <comment id="3061314" author="dmitry.lukyanov" created="Wed, 29 Apr 2020 20:27:42 +0000"  >&lt;p&gt;Hello &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=michael_fyffe%40homedepot.com&quot; class=&quot;user-hover&quot; rel=&quot;michael_fyffe@homedepot.com&quot;&gt;michael_fyffe@homedepot.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;That is by design. All LINQ queries are translated to an aggregation pipeline. While it is true that some simple LINQ queries could in theory be translated to a Find query, many other LINQ queries need to be translated to an aggregation pipeline because they need features that are not available in a simple Find. There is no performance penalty for using an aggregation pipeline, so there is no need to make any attempt to translate simple LINQ queries to a Find query instead of an aggregation pipeline. Therefore, all LINQ queries are translated to an aggregation pipeline no matter how simple they might be. &lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hx5s9r:</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>