<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:40:28 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-1714] Cannot translate simple expression. InvalidOperationException in Linq.Translators.PredicateTranslator: {document} not supported.</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1714</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;The exception occurs in the method GetFieldExpression, for the following expression:&lt;br/&gt;
e =&amp;gt; ((e.GetType() == BusinessPartner) AndAlso (e.PrivateExchangeId == &quot;something&quot;))&lt;/p&gt;

&lt;p&gt;The code triggering the exception is:&lt;/p&gt;

&lt;p&gt;      var documentSerializer = BsonSerializer.SerializerRegistry.GetSerializer&amp;lt;T&amp;gt;();&lt;br/&gt;
      var renderedFilter = filterDefinition.Render(documentSerializer, BsonSerializer.SerializerRegistry).ToString(); // the exception occurs in Render&lt;/p&gt;

&lt;p&gt;The filter definition is of type MongoDB.Driver.AndFilterDefinition&amp;lt;BusinessPartner&amp;gt;, and has as expression the expression provided above.&lt;/p&gt;</description>
                <environment>Windows 10 x64, IIS.</environment>
        <key id="302503">CSHARP-1714</key>
            <summary>Cannot translate simple expression. InvalidOperationException in Linq.Translators.PredicateTranslator: {document} 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="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="ioan.crisan@soloplan.de">Ioan Crisan</reporter>
                        <labels>
                    </labels>
                <created>Wed, 20 Jul 2016 08:07:00 +0000</created>
                <updated>Tue, 31 Oct 2017 21:24:59 +0000</updated>
                            <resolved>Wed, 20 Jul 2016 14:46:57 +0000</resolved>
                                    <version>2.2.4</version>
                                                    <component>API</component>
                    <component>Linq</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="1714044" author="sunnybg" created="Tue, 31 Oct 2017 21:22:41 +0000"  >&lt;p&gt;@Lewis Gill ... As I was not able to reopen the issue, I cloned it to &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-2080&quot; title=&quot;Cannot translate simple expression: InvalidOperationException&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-2080&quot;&gt;CSHARP-2080&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I also have put my workaround there.&lt;/p&gt;</comment>
                            <comment id="1564402" author="lewisrg" created="Thu, 4 May 2017 13:42:30 +0000"  >&lt;p&gt;I&apos;m running into the same error here, but 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.  &lt;/p&gt;

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

&lt;p&gt;Type type = typeof(string);&lt;/p&gt;

&lt;p&gt; query.Where( c =&amp;gt; c.GetType() == type);&lt;/p&gt;</comment>
                            <comment id="1329854" author="ioan.crisan@soloplan.de" created="Wed, 20 Jul 2016 14:34:44 +0000"  >&lt;p&gt;I suppose you can close this issue now. Thanks again!&lt;/p&gt;</comment>
                            <comment id="1329811" author="ioan.crisan@soloplan.de" created="Wed, 20 Jul 2016 14:19:22 +0000"  >&lt;p&gt;It works with the &lt;b&gt;is&lt;/b&gt; operator, thanks!&lt;/p&gt;</comment>
                            <comment id="1329668" author="ioan.crisan@soloplan.de" created="Wed, 20 Jul 2016 12:51:47 +0000"  >&lt;p&gt;Hi Craig,&lt;/p&gt;

&lt;p&gt;it is accurate, because due to this error we cannot update the driver to this version to be able to get a more detailed log. We have some strange latencies that we observed in the production environment, which we could reproduce locally, but without this newer driver we cannot investigate further (see CS-27499 for that matter - we managed to reproduce the situation when the driver needs 6 seconds for retrieving 350 entities, while the database logs indicate milliseconds).&lt;/p&gt;

&lt;p&gt;I will check to see if I can change the expression as indicated.&lt;/p&gt;

&lt;p&gt;Thanks for the update,&lt;br/&gt;
Ioan&lt;/p&gt;</comment>
                            <comment id="1329582" author="craiggwilson" created="Wed, 20 Jul 2016 11:49:22 +0000"  >&lt;p&gt;Hi Ioan,&lt;/p&gt;

&lt;p&gt;I see you&apos;ve marked this as critical. Is that accurate? The exception in this code is getting generated by the e.GetType() == BusinessPartner. Could you try using &lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;(e is BusinessPartner)&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt; instead. I believe I see some support for that variation in the code.&lt;/p&gt;

&lt;p&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|hsnrmn:</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>