<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:48:47 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-4616] Linqprovider V3 IMongoCollection&lt;T&gt;.AsQueryable().OfType&lt;T&gt; does not match derived types</title>
                <link>https://jira.mongodb.org/browse/CSHARP-4616</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;h4&gt;&lt;a name=&quot;Summary&quot;&gt;&lt;/a&gt;Summary&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;When using Linqprovider V3 IMongoCollection&amp;lt;T&amp;gt;.AsQueryable().OfType&amp;lt;T&amp;gt; does not match derived types.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Query Produced in V3&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;{&lt;/em&gt;&lt;br/&gt;
&#160; &#160; &lt;em&gt;basis_dev.jobs.Aggregate([{&lt;/em&gt;&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;em&gt;&lt;font color=&quot;#FF0000&quot;&gt;&quot;$match&quot;: {&lt;/font&gt;&lt;/em&gt;&lt;br/&gt;
&lt;font color=&quot;#FF0000&quot;&gt;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; _&quot;&lt;em&gt;t&quot;: &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;Entity&amp;quot;, &amp;quot;Job&amp;quot;&amp;#93;&lt;/span&gt;&lt;/em&gt;&lt;/font&gt;&lt;br/&gt;
&lt;font color=&quot;#FF0000&quot;&gt;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;em&gt;}&lt;/em&gt;&lt;/font&gt;&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;em&gt;}, {&lt;/em&gt;&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;em&gt;&quot;$match&quot;: {&lt;/em&gt;&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;em&gt;&quot;ParentJobId&quot;: {&lt;/em&gt;&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;em&gt;&quot;$in&quot;: &lt;span class=&quot;error&quot;&gt;&amp;#91;ObjectId(&amp;quot;6438717105606533eb0d2bfe&amp;quot;), ObjectId(&amp;quot;6438717105606533eb0d2bff&amp;quot;), ObjectId(&amp;quot;6438717105606533eb0d2c00&amp;quot;), ObjectId(&amp;quot;6438717105606533eb0d2c01&amp;quot;), ObjectId(&amp;quot;6438717105606533eb0d2c02&amp;quot;), ObjectId(&amp;quot;6438717105606533eb0d2c03&amp;quot;)&amp;#93;&lt;/span&gt;&lt;/em&gt;&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;em&gt;}&lt;/em&gt;&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;em&gt;}&lt;/em&gt;&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;em&gt;}&lt;/em&gt;&lt;br/&gt;
&#160; &#160; &#160; &#160; &lt;em&gt;])&lt;/em&gt;&lt;br/&gt;
&lt;em&gt;}&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;em&gt;Query Produced in V2&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;{&lt;/em&gt;&lt;br/&gt;
&#160; &#160; &lt;em&gt;aggregate([{&lt;/em&gt;&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;em&gt;&lt;font color=&quot;#FF0000&quot;&gt; &quot;$match&quot;: {&lt;/font&gt;&lt;/em&gt;&lt;br/&gt;
&lt;font color=&quot;#FF0000&quot;&gt;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; _&quot;&lt;em&gt;t&quot;: &quot;Job&quot;&lt;/em&gt;&lt;/font&gt;&lt;br/&gt;
&lt;font color=&quot;#FF0000&quot;&gt;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;em&gt;}&lt;/em&gt;&lt;/font&gt;&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;em&gt;}, {&lt;/em&gt;&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;em&gt;&quot;$match&quot;: {&lt;/em&gt;&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;em&gt;&quot;ParentJobId&quot;: {&lt;/em&gt;&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;em&gt;&quot;$in&quot;: &lt;span class=&quot;error&quot;&gt;&amp;#91;ObjectId(&amp;quot;6438717105606533eb0d2bfe&amp;quot;), ObjectId(&amp;quot;6438717105606533eb0d2bff&amp;quot;), ObjectId(&amp;quot;6438717105606533eb0d2c00&amp;quot;), ObjectId(&amp;quot;6438717105606533eb0d2c01&amp;quot;), ObjectId(&amp;quot;6438717105606533eb0d2c02&amp;quot;), ObjectId(&amp;quot;6438717105606533eb0d2c03&amp;quot;)&amp;#93;&lt;/span&gt;&lt;/em&gt;&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;em&gt;}&lt;/em&gt;&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;em&gt;}&lt;/em&gt;&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;em&gt;}&lt;/em&gt;&lt;br/&gt;
&#160; &#160; &#160; &#160; &lt;em&gt;])&lt;/em&gt;&lt;br/&gt;
&lt;em&gt;}&lt;/em&gt;&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Pleaseprovidetheversionofthedriver.Ifapplicable%2CpleaseprovidetheMongoDBserverversionandtopology%28standalone%2Creplicaset%2Corshardedcluster%29.&quot;&gt;&lt;/a&gt;Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).&lt;/h4&gt;

&lt;p&gt;Version 2.18.0 and version 2.19.1 were tested and both result in the same query.&#160;&lt;/p&gt;

&lt;p&gt;Mongo Atlas 6.0.5&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;HowtoReproduce&quot;&gt;&lt;/a&gt;How to Reproduce&lt;/h4&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;JsonKnownType&amp;#93;&lt;/span&gt;&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;BsonKnownType&amp;#93;&lt;/span&gt;&lt;br/&gt;
public abstract class Entity&lt;/p&gt;
{
&#160; &#160; [BsonId]
&#160; &#160; [JsonProperty(&quot;id&quot;)]
&#160; &#160; [BsonRepresentation(BsonType.ObjectId)]
&#160; &#160; public string Id \{ get; set; }

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Entity is set as root and as KnownType&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;Table(Constants.MongoDb.CollectionNames.Jobs)&amp;#93;&lt;/span&gt;&lt;br/&gt;
public abstract class Job : Entity&lt;/p&gt;
{
&#160; &#160;
&#160; &#160; [BsonRepresentation(BsonType.ObjectId)]
&#160; &#160; public string ParentJobId \{ get; set; }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;public class SampleJob : Job&lt;/p&gt;
{
&#160; &#160; public string SampleJobName \{ get; set; }
&lt;p&gt;&#160; &#160; public TimeSpan? TimeSpan { get; set; }&lt;br/&gt;
}&lt;/p&gt;

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

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

&lt;p&gt;var parentJobIds = new List&amp;lt;string&amp;gt; { &quot;6438717105606533eb0d2bfe&quot; };&lt;/p&gt;

&lt;p&gt;IMongoCollection&amp;lt;Job&amp;gt;.AsQueryable().OfType&amp;lt;Job&amp;gt;().Where(x=&amp;gt; parentJobIds.Contains(x.ParentJobId));&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;AdditionalBackground&quot;&gt;&lt;/a&gt;Additional Background&lt;/h4&gt;

&lt;p&gt;The expected result of the query should return all derived Job types, SampleJob being one of them, but it does not.&#160;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This works fine in LinqProviderV2 and is preventing us from moving to V3.&lt;/em&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="2314967">CSHARP-4616</key>
            <summary>Linqprovider V3 IMongoCollection&lt;T&gt;.AsQueryable().OfType&lt;T&gt; does not match derived types</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="10300" iconUrl="https://jira.mongodb.org/images/icons/priorities/medium.svg">Unknown</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="oleksandr.poliakov@mongodb.com">Oleksandr Poliakov</assignee>
                                    <reporter username="dferrante@darlingconsulting.com">David Ferrante</reporter>
                        <labels>
                            <label>triage</label>
                    </labels>
                <created>Fri, 14 Apr 2023 13:05:06 +0000</created>
                <updated>Sat, 28 Oct 2023 11:46:54 +0000</updated>
                            <resolved>Fri, 5 May 2023 20:21:17 +0000</resolved>
                                                    <fixVersion>2.19.2</fixVersion>
                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="5433626" author="xgen-internal-githook" created="Thu, 18 May 2023 00:39:19 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Oleksandr Poliakov&apos;, &apos;email&apos;: &apos;31327136+sanych-sun@users.noreply.github.com&apos;, &apos;username&apos;: &apos;sanych-sun&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-4616&quot; title=&quot;Linqprovider V3 IMongoCollection&amp;lt;T&amp;gt;.AsQueryable().OfType&amp;lt;T&amp;gt; does not match derived types&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-4616&quot;&gt;&lt;del&gt;CSHARP-4616&lt;/del&gt;&lt;/a&gt;: OfType should match derived types (#1075)&lt;br/&gt;
Branch: v2.19.x&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/commit/9d8787127a2000dbeee83ee03352a5fc0b4bc876&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/commit/9d8787127a2000dbeee83ee03352a5fc0b4bc876&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5405320" author="xgen-internal-githook" created="Fri, 5 May 2023 20:18:47 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Oleksandr Poliakov&apos;, &apos;email&apos;: &apos;31327136+sanych-sun@users.noreply.github.com&apos;, &apos;username&apos;: &apos;sanych-sun&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-4616&quot; title=&quot;Linqprovider V3 IMongoCollection&amp;lt;T&amp;gt;.AsQueryable().OfType&amp;lt;T&amp;gt; does not match derived types&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-4616&quot;&gt;&lt;del&gt;CSHARP-4616&lt;/del&gt;&lt;/a&gt;: OfType should match derived types (#1075)&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/commit/71f42618e719caeb1c83299d6705115bec3e2643&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/commit/71f42618e719caeb1c83299d6705115bec3e2643&lt;/a&gt;&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_10257" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Documentation Changes</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="11861"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_14266" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Documentation Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;1.  What would you like to communicate to the user about this feature?&lt;br/&gt;
2.  Would you like the user to see examples of the syntax and/or executable code and its output?&lt;br/&gt;
3.  Which versions of the driver/connector does this apply to?&lt;/p&gt;</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1n2ts:</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>