<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:43:05 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-2630] query filter on datetime field with lambda expression gives System.InvalidOperationException:  {document..} is not supported </title>
                <link>https://jira.mongodb.org/browse/CSHARP-2630</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;Could you please assist to get query working for below criteria ?&#160;&lt;/p&gt;

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

&lt;p&gt;var filter3 = Builders&amp;lt;documentType&amp;gt;.Filter.Gt(f =&amp;gt; f.usehour, 0)&lt;br/&gt;
 &amp;amp; Builders&amp;lt;documentType&amp;gt;.Filter.Ne(&quot;ExpirationDate&quot;, BsonNull.Value)&lt;br/&gt;
 &amp;amp; Builders&amp;lt;documentType&amp;gt;.Filter.Gt(f =&amp;gt; f.ExpirationDate, DateTime.Now)&lt;br/&gt;
 &lt;ins&gt;&lt;b&gt;&amp;amp; Builders&amp;lt;documentType&amp;gt;.Filter.Where(f =&amp;gt; f.ExpirationDate.AddHours(f.usehour) &amp;gt; DateTime.Now )&lt;/b&gt;&lt;/ins&gt;&lt;/p&gt;

&lt;p&gt;//&amp;amp; Builders&amp;lt;documentType&amp;gt;.Filter.Gt(f =&amp;gt; f.ExpirationDate.AddHours(f.usehour) , DateTime.Now);&#160; // tried this also&lt;/p&gt;

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

&lt;p&gt;Exception details:&lt;/p&gt;

{document}{ExpirationDate}.AddHours(Convert({document}{usehour}, Double)) is not supported.&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
 {System.InvalidOperationException: {document}
{ExpirationDate}
&lt;p&gt;.AddHours(Convert({document}&lt;/p&gt;
{usehour}
&lt;p&gt;, Double)) is not supported.&lt;br/&gt;
 at MongoDB.Driver.Linq.Translators.PredicateTranslator.GetFieldExpression(Expression expression)&lt;br/&gt;
 at MongoDB.Driver.Linq.Translators.PredicateTranslator.TranslateComparison(Expression variableExpression, ExpressionType operatorType, ConstantExpression constantExpression)&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.AndFilterDefinition`1.Render(IBsonSerializer`1 documentSerializer, IBsonSerializerRegistry serializerRegistry)&lt;br/&gt;
 at MongoDB.Driver.OrFilterDefinition`1.Render(IBsonSerializer`1 documentSerializer, IBsonSerializerRegistry serializerRegistry)&lt;br/&gt;
 at MongoDB.Driver.AndFilterDefinition`1.Render(IBsonSerializer`1 documentSerializer, IBsonSerializerRegistry serializerRegistry)&lt;br/&gt;
 at MongoDB.Driver.MongoCollectionImpl`1.CreateFindOperation&lt;span class=&quot;error&quot;&gt;&amp;#91;TProjection&amp;#93;&lt;/span&gt;(FilterDefinition`1 filter, FindOptions`2 options)&lt;br/&gt;
 at MongoDB.Driver.MongoCollectionImpl`1.FindSync&lt;span class=&quot;error&quot;&gt;&amp;#91;TProjection&amp;#93;&lt;/span&gt;(IClientSessionHandle session, FilterDefinition`1 filter, FindOptions`2 options, CancellationToken cancellationToken)&lt;br/&gt;
 at MongoDB.Driver.MongoCollectionImpl`1.&amp;lt;&amp;gt;c_&lt;em&gt;DisplayClass41_0`1.&amp;lt;FindSync&amp;gt;b&lt;/em&gt;_0(IClientSessionHandle session)&lt;br/&gt;
 at MongoDB.Driver.MongoCollectionImpl`1.UsingImplicitSession&lt;span class=&quot;error&quot;&gt;&amp;#91;TResult&amp;#93;&lt;/span&gt;(Func`2 func, CancellationToken cancellationToken)&lt;br/&gt;
 at MongoDB.Driver.MongoCollectionImpl`1.FindSync&lt;span class=&quot;error&quot;&gt;&amp;#91;TProjection&amp;#93;&lt;/span&gt;(FilterDefinition`1 filter, FindOptions`2 options, CancellationToken cancellationToken)&lt;br/&gt;
 at MongoDB.Driver.FindFluent`2.ToCursor(CancellationToken cancellationToken)&lt;br/&gt;
 at MongoDB.Driver.IAsyncCursorSourceExtensions.ToList&lt;span class=&quot;error&quot;&gt;&amp;#91;TDocument&amp;#93;&lt;/span&gt;(IAsyncCursorSource`1 source, CancellationToken cancellationToken)&lt;/p&gt;

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

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

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment>Windows server 2012, visual studio, C# mongodb .net driver</environment>
        <key id="796077">CSHARP-2630</key>
            <summary>query filter on datetime field with lambda expression gives System.InvalidOperationException:  {document..} is not supported </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="9">Done</resolution>
                                        <assignee username="wan.bachtiar@mongodb.com">Wan Bachtiar</assignee>
                                    <reporter username="poonam494">Poonam</reporter>
                        <labels>
                    </labels>
                <created>Tue, 11 Jun 2019 04:22:46 +0000</created>
                <updated>Thu, 25 Jun 2020 02:28:06 +0000</updated>
                            <resolved>Thu, 25 Jun 2020 02:28:06 +0000</resolved>
                                    <version>2.8.0</version>
                                                    <component>Builders</component>
                    <component>Linq</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="3223178" author="rachelle.palmer" created="Thu, 25 Jun 2020 02:28:06 +0000"  >&lt;p&gt;Hi there, thank you for reaching out to MongoDB. As this sounds more like a support issue, I wanted to give you some resources to get this question answered more quickly:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;our MongoDB support portal, located at &lt;a href=&quot;https://support.mongodb.com/welcome&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;support.mongodb.com&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;our MongoDB community forums, located &lt;a href=&quot;https://developer.mongodb.com/community/forums/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;If you are an Atlas customer, there is free support offered 24/7 in the lower right hand corner of the UI.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Thank you!&lt;br/&gt;
Rachelle&lt;/p&gt;</comment>
                            <comment id="2278918" author="poonam494" created="Tue, 11 Jun 2019 04:28:47 +0000"  >&lt;p&gt;if try with this&lt;/p&gt;

&lt;p&gt;Builders&amp;lt;documnetType&amp;gt;.Filter.Gt(f =&amp;gt; f.ExpirationDate.AddHours(f.usehour) , DateTime.Now); gives this exception&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Unable to determine the serialization information&#160;for&#160; f.ExpirationDate.AddHours(f.usehour)&lt;/b&gt;&#160;&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|hutapb:</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>