<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:38:16 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-948] Take() in Where().OrderBy().Take().Any() not working.</title>
                <link>https://jira.mongodb.org/browse/CSHARP-948</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;I found a quite specific case, when &lt;br/&gt;
Where().OrderBy().Take().Any() &lt;br/&gt;
does not work as expected, while Where().OrderBy().Take().AsEnumerable().Any()&lt;br/&gt;
gives the correct result. Find below the code example:&lt;/p&gt;

&lt;p&gt;var repository = new MongoRepository();&lt;/p&gt;

&lt;p&gt;var id = new Guid(&quot;08d12048-7851-bc17-259f-9b16589f0d15&quot;);&lt;br/&gt;
const string Username = &quot;testu&quot;;&lt;br/&gt;
var queryable = repository.database.GetCollection&amp;lt;Machine&amp;gt;(&quot;machine&quot;).AsQueryable();&lt;br/&gt;
var userMachines = queryable.Where(m =&amp;gt; m.Username == Username).OrderBy(m =&amp;gt; m.CreatedOn);&lt;br/&gt;
var mustBeTrue = userMachines.Take(3).Any(m =&amp;gt; m.Id == id) == userMachines.Take(3).AsEnumerable().Any(m =&amp;gt; m.Id == id);&lt;br/&gt;
Console.WriteLine(mustBeTrue)&lt;br/&gt;
-------&lt;br/&gt;
Prints &quot;False&quot;. repository.database is of type MongoDatabase. CreatedOn is DateTime.&lt;/p&gt;</description>
                <environment>Both MongoDB and consumer app run on Windows 7 x64</environment>
        <key id="129691">CSHARP-948</key>
            <summary>Take() in Where().OrderBy().Take().Any() 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="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="sologub">Ruslan Sologub</reporter>
                        <labels>
                            <label>driver</label>
                    </labels>
                <created>Mon, 7 Apr 2014 07:42:54 +0000</created>
                <updated>Wed, 20 Jan 2016 20:09:56 +0000</updated>
                            <resolved>Mon, 27 Apr 2015 14:34:09 +0000</resolved>
                                    <version>1.8.3</version>
                                    <fixVersion>2.1</fixVersion>
                                    <component>Linq</component>
                                        <votes>1</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="898250" author="xgen-internal-githook" created="Sun, 26 Apr 2015 13:02:58 +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-948&quot; title=&quot;Take() in Where().OrderBy().Take().Any() not working.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-948&quot;&gt;&lt;del&gt;CSHARP-948&lt;/del&gt;&lt;/a&gt;: added support for Any at the root.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/commit/88294d4414d11c93aab8ace3fc401388ebaa69fe&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/commit/88294d4414d11c93aab8ace3fc401388ebaa69fe&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="538987" author="craiggwilson" created="Mon, 7 Apr 2014 13:31:41 +0000"  >&lt;p&gt;Hi Ruslan,&lt;/p&gt;

&lt;p&gt;Took me a while to figure this out (although I haven&apos;t reproduced).  If this is NOT throwing an error, then the bug is that it should be.  This particular query isn&apos;t currently possible in MongoDB using the query engine because you have 2 predicates, one before a Take() and one after.  This will be possible after &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-601&quot; title=&quot;Linq to Aggregation Framework&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-601&quot;&gt;&lt;del&gt;CSHARP-601&lt;/del&gt;&lt;/a&gt; is completed.&lt;/p&gt;

&lt;p&gt;I&apos;m going to assign a fixVersion of 3.0 and lump it in with the other Linq tickets that are dependent on &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-601&quot; title=&quot;Linq to Aggregation Framework&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-601&quot;&gt;&lt;del&gt;CSHARP-601&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thanks for the report.&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_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|hs7us7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>103719</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>