<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:41: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-1980] Support Where(c =&gt; c.GetType() == type) in LINQ</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1980</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;I think this is the same issue as &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-1714&quot; title=&quot;Cannot translate simple expression. InvalidOperationException in Linq.Translators.PredicateTranslator: {document} not supported.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-1714&quot;&gt;&lt;del&gt;CSHARP-1714&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;However, I cannot use the &quot;is&quot; clause workaround because I have a set of Type variables that I&apos;m using to build up a dynamic LINQ query, so I can&apos;t use the &quot;is&quot; clause, which requires a constant expression.&lt;/p&gt;

&lt;p&gt;Is there now a way to make the following work with MongoDB?&lt;/p&gt;

&lt;p&gt;Type type1 = typeof(MyObject1);&lt;br/&gt;
Type type2 = typeof(MyObject2);&lt;br/&gt;
query.Where( c =&amp;gt; c.GetType() == type1 ||  c =&amp;gt; c.GetType() == type2);&lt;/p&gt;

&lt;p&gt;I&apos;ve manually verified that using an &quot;is&quot; clause does work on the same query.&lt;/p&gt;</description>
                <environment>Windows 10 x64</environment>
        <key id="382012">CSHARP-1980</key>
            <summary>Support Where(c =&gt; c.GetType() == type) in LINQ</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="lewisrg">Lewis Gill</reporter>
                        <labels>
                    </labels>
                <created>Mon, 8 May 2017 17:50:24 +0000</created>
                <updated>Thu, 31 Mar 2022 00:50:15 +0000</updated>
                                            <version>2.4.3</version>
                                                    <component>API</component>
                    <component>Linq</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="2191487" author="brechtvhb" created="Tue, 26 Mar 2019 09:03:43 +0000"  >&lt;p&gt;I&apos;d love to see this feature too.&lt;/p&gt;</comment>
                            <comment id="1572696" author="rstam" created="Tue, 16 May 2017 19:53:01 +0000"  >&lt;p&gt;I&apos;ve reclassified this as an improvement request rather than a bug.&lt;/p&gt;

&lt;p&gt;This particular LINQ query is currently not supported.&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|hr8utr:</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>