<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:40:04 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-1592] Nullable comparison throws ArgumentException - {&quot;Unsupported filter</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1592</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;I have a class with 2 Nullable DateTime properties.&lt;br/&gt;
The query that I&apos;m trying to run is:&lt;/p&gt;

&lt;p&gt;Repository.GetAll().Where(_ =&amp;gt; _.DateDelivered.HasValue &amp;amp;&amp;amp; _.DateDue.HasValue &amp;amp;&amp;amp; _.DateDelivered.Value == _.DateDue.Value);&lt;/p&gt;

&lt;p&gt;I&apos;m getting the following exception:&lt;br/&gt;
System.ArgumentException {&quot;Unsupported filter: (Convert(&lt;/p&gt;
{document}{DateDelivered}) == Convert({document}
{DateDue}
&lt;p&gt;)).&quot;}&lt;br/&gt;
StackTrace : &lt;br/&gt;
   at MongoDB.Driver.Linq.Translators.PredicateTranslator.Translate(Expression node)&lt;br/&gt;
   at MongoDB.Driver.Linq.Translators.PredicateTranslator.TranslateAndAlso(BinaryExpression node)&lt;br/&gt;
   at MongoDB.Driver.Linq.Translators.PredicateTranslator.Translate(Expression node)&lt;br/&gt;
   at MongoDB.Driver.Linq.Translators.PredicateTranslator.Translate(Expression node, IBsonSerializerRegistry serializerRegistry)&lt;br/&gt;
   at MongoDB.Driver.Linq.Translators.QueryableTranslator.TranslateWhere(WhereExpression node)&lt;br/&gt;
   at MongoDB.Driver.Linq.Translators.QueryableTranslator.Translate(Expression node)&lt;br/&gt;
   at MongoDB.Driver.Linq.Translators.QueryableTranslator.TranslatePipeline(PipelineExpression node)&lt;br/&gt;
   at MongoDB.Driver.Linq.Translators.QueryableTranslator.Translate(Expression node)&lt;br/&gt;
   at MongoDB.Driver.Linq.Translators.QueryableTranslator.Translate(Expression node, IBsonSerializerRegistry serializerRegistry)&lt;br/&gt;
   at MongoDB.Driver.Linq.MongoQueryProviderImpl`1.Translate(Expression expression)&lt;br/&gt;
   at MongoDB.Driver.Linq.MongoQueryProviderImpl`1.Execute(Expression expression)&lt;br/&gt;
   at MongoDB.Driver.Linq.MongoQueryableImpl`2.GetEnumerator()&lt;br/&gt;
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)&lt;br/&gt;
   at System.Linq.Enumerable.ToList&lt;span class=&quot;error&quot;&gt;&amp;#91;TSource&amp;#93;&lt;/span&gt;(IEnumerable`1 source)&lt;br/&gt;
   at Moravia.SymLite.Toolkit.Toolkit.Main(String[] args) in c:&amp;#95;work\projects\symfonie-lite\Toolkit\Toolkit.Main.cs:line 29&lt;br/&gt;
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)&lt;br/&gt;
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)&lt;br/&gt;
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()&lt;br/&gt;
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)&lt;br/&gt;
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)&lt;br/&gt;
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)&lt;br/&gt;
   at System.Threading.ThreadHelper.ThreadStart()&lt;/p&gt;</description>
                <environment></environment>
        <key id="270429">CSHARP-1592</key>
            <summary>Nullable comparison throws ArgumentException - {&quot;Unsupported filter</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.mongodb.org/images/icons/priorities/critical.svg">Critical - P2</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="-1">Unassigned</assignee>
                                    <reporter username="ccasanova81">Carlos Casanova</reporter>
                        <labels>
                    </labels>
                <created>Mon, 7 Mar 2016 15:37:13 +0000</created>
                <updated>Fri, 11 Mar 2016 20:25:27 +0000</updated>
                            <resolved>Fri, 11 Mar 2016 20:25:27 +0000</resolved>
                                    <version>2.2.3</version>
                                                    <component>Linq</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="1201118" author="craiggwilson" created="Fri, 11 Mar 2016 20:25:27 +0000"  >&lt;p&gt;Hi Carlos,&lt;/p&gt;

&lt;p&gt;I&apos;ve taken a look and nullable types work as they are supposed to. The issue with your query is that MongoDB does not allowing comparing two fields to each other. You can only compare fields to a constant. Because of this restriction, we cannot convert the query. It is simply not valid MongoDB syntax.&lt;/p&gt;

&lt;p&gt;I&apos;m going to close this ticket as Works as Designed. Feel free to ping back if you feel this is an error.&lt;br/&gt;
Craig&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|hsj4jr:</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>