<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:47:11 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-4090] x =&gt; x.Name.Contains(&quot;FirstName&quot;, StringComparison.CurrentCultureIgnoreCase) throws NotSupportedException</title>
                <link>https://jira.mongodb.org/browse/CSHARP-4090</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;Hi, when I trying to query LINQ request x =&amp;gt; x.Name.Contains(&quot;FirstName&quot;, StringComparison.CurrentCultureIgnoreCase) ** throw the following error message.&lt;/p&gt;

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

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;Expression not supported: x.Name.Contains(&quot;FirstName&quot;, CurrentCultureIgnoreCase).&lt;/p&gt;

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

&lt;p&gt;Following are my using&lt;/p&gt;

&lt;p&gt;&#160;- Mongo driver: &lt;b&gt;v2.14.1&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&#160;**&#160;- Linq provider: clientSettings.LinqProvider = LinqProvider.V3&lt;/p&gt;

&lt;p&gt;NOTE: Original description described the problem that OrdinalIgnoreCase doesn&apos;t work. This is expected and explained below in the comments.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="1997429">CSHARP-4090</key>
            <summary>x =&gt; x.Name.Contains(&quot;FirstName&quot;, StringComparison.CurrentCultureIgnoreCase) throws NotSupportedException</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</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="13201">Fixed</resolution>
                                        <assignee username="james.kovacs@mongodb.com">James Kovacs</assignee>
                                    <reporter username="453532579@qq.com">Chock chen</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Mar 2022 06:06:07 +0000</created>
                <updated>Sat, 28 Oct 2023 11:47:19 +0000</updated>
                            <resolved>Tue, 15 Mar 2022 16:10:52 +0000</resolved>
                                    <version>2.14.1</version>
                                    <fixVersion>2.15.1</fixVersion>
                                    <component>LINQ3</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="4526501" author="xgen-internal-githook" created="Wed, 4 May 2022 18:11:28 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;James Kovacs&apos;, &apos;email&apos;: &apos;jkovacs@post.harvard.edu&apos;, &apos;username&apos;: &apos;JamesKovacs&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-4090&quot; title=&quot;x =&amp;gt; x.Name.Contains(&amp;quot;FirstName&amp;quot;, StringComparison.CurrentCultureIgnoreCase) throws NotSupportedException&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-4090&quot;&gt;&lt;del&gt;CSHARP-4090&lt;/del&gt;&lt;/a&gt; / &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-4092&quot; title=&quot;Case-insensitive StartsWith/EndsWith generates incorrect MQL&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-4092&quot;&gt;&lt;del&gt;CSHARP-4092&lt;/del&gt;&lt;/a&gt; (#750)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-4090&quot; title=&quot;x =&amp;gt; x.Name.Contains(&amp;quot;FirstName&amp;quot;, StringComparison.CurrentCultureIgnoreCase) throws NotSupportedException&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-4090&quot;&gt;&lt;del&gt;CSHARP-4090&lt;/del&gt;&lt;/a&gt;: Implement support for string.Contains(match, StringComparison).&lt;br/&gt;
&lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-4092&quot; title=&quot;Case-insensitive StartsWith/EndsWith generates incorrect MQL&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-4092&quot;&gt;&lt;del&gt;CSHARP-4092&lt;/del&gt;&lt;/a&gt;: Fix case-insensitive StartsWith/EndsWith to generate correct MQL.&lt;br/&gt;
Branch: v2.15.x&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/commit/f8bc005a1c866e13ac044dbe28708186b4bc184f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/commit/f8bc005a1c866e13ac044dbe28708186b4bc184f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4413248" author="xgen-internal-githook" created="Tue, 15 Mar 2022 16:08:47 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;James Kovacs&apos;, &apos;email&apos;: &apos;jkovacs@post.harvard.edu&apos;, &apos;username&apos;: &apos;JamesKovacs&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-4090&quot; title=&quot;x =&amp;gt; x.Name.Contains(&amp;quot;FirstName&amp;quot;, StringComparison.CurrentCultureIgnoreCase) throws NotSupportedException&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-4090&quot;&gt;&lt;del&gt;CSHARP-4090&lt;/del&gt;&lt;/a&gt; / &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-4092&quot; title=&quot;Case-insensitive StartsWith/EndsWith generates incorrect MQL&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-4092&quot;&gt;&lt;del&gt;CSHARP-4092&lt;/del&gt;&lt;/a&gt; (#750)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-4090&quot; title=&quot;x =&amp;gt; x.Name.Contains(&amp;quot;FirstName&amp;quot;, StringComparison.CurrentCultureIgnoreCase) throws NotSupportedException&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-4090&quot;&gt;&lt;del&gt;CSHARP-4090&lt;/del&gt;&lt;/a&gt;: Implement support for string.Contains(match, StringComparison).&lt;br/&gt;
&lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-4092&quot; title=&quot;Case-insensitive StartsWith/EndsWith generates incorrect MQL&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-4092&quot;&gt;&lt;del&gt;CSHARP-4092&lt;/del&gt;&lt;/a&gt;: Fix case-insensitive StartsWith/EndsWith to generate correct MQL.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/commit/c8b95a34f282a76769890d335d35dd2f76659a42&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/commit/c8b95a34f282a76769890d335d35dd2f76659a42&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4405619" author="JIRAUSER1269872" created="Fri, 11 Mar 2022 01:02:00 +0000"  >&lt;p&gt;Hi, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=james.kovacs&quot; class=&quot;user-hover&quot; rel=&quot;james.kovacs&quot;&gt;james.kovacs&lt;/a&gt;&#160;&#160;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=dmitry.lukyanov&quot; class=&quot;user-hover&quot; rel=&quot;dmitry.lukyanov&quot;&gt;dmitry.lukyanov&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Okay! Thank you for your feedback&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="4402091" author="james.kovacs" created="Wed, 9 Mar 2022 21:12:37 +0000"  >&lt;p&gt;Hi, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=453532579%40qq.com&quot; class=&quot;user-hover&quot; rel=&quot;453532579@qq.com&quot;&gt;453532579@qq.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;We have investigated the issue further and understand the root cause. A few wrinkles to mention...&lt;/p&gt;

&lt;p&gt;We currently only support &lt;tt&gt;StringComparison.CurrentCultureIgnoreCase&lt;/tt&gt;. To perform case-insensitive comparisons, we use &lt;a href=&quot;https://docs.mongodb.com/manual/reference/operator/aggregation/toLower/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;$toLower&lt;/a&gt;, which only has well-defined behaviour on ASCII characters. While neither &lt;tt&gt;StringComparison.CurrentCultureIgnoreCase&lt;/tt&gt; nor &lt;tt&gt;StringComparison.OrdinalIgnoreCase&lt;/tt&gt; quite expresses this limitation, we chose to use &lt;tt&gt;StringComparison.CurrentCultureIgnoreCase&lt;/tt&gt; as &lt;tt&gt;StringComparison.CurrentCulture&lt;/tt&gt; is the default in .NET.&lt;/p&gt;

&lt;p&gt;I&apos;ve updated the title and description to reflect that &lt;tt&gt;StringComparison.CurrentCultureIgnoreCase&lt;/tt&gt; throws a &lt;tt&gt;NotSupportedException&lt;/tt&gt; when it shouldn&apos;t. We will continue to throw &lt;tt&gt;NotSupportedException&lt;/tt&gt; for &lt;tt&gt;StringComparison.OrdinalIgnoreCase&lt;/tt&gt; until the database supports ordinal comparisons.&lt;/p&gt;

&lt;p&gt;The next wrinkle... &lt;tt&gt;string.Contains(string, StringComparison)&lt;/tt&gt; is only available starting in .NET Standard 2.1. Thus it will only work if you are targeting .NET Core 3.X, .NET 5, or .NET 6. Notably it will not work with .NET Core 2.X nor .NET Framework. Interestingly you can compile a .NET Core 2.1 app (but not 2.0) using this overload, but NuGet packages target .NET Standard, not particular runtimes, and thus cannot provide support for this overload until .NET Standard 2.1 - which requires .NET Core 3.X or later.&lt;/p&gt;

&lt;p&gt;Last wrinkle... While investigating this issue, we discovered a related issue &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-4092&quot; title=&quot;Case-insensitive StartsWith/EndsWith generates incorrect MQL&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-4092&quot;&gt;&lt;del&gt;CSHARP-4092&lt;/del&gt;&lt;/a&gt;. We have a fix for the &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-4092&quot; title=&quot;Case-insensitive StartsWith/EndsWith generates incorrect MQL&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-4092&quot;&gt;&lt;del&gt;CSHARP-4092&lt;/del&gt;&lt;/a&gt; and have implemented support for &lt;tt&gt;string.Contains(string, StringComparison)&lt;/tt&gt;. It will be available in an upcoming release.&lt;/p&gt;

&lt;p&gt;Sincerely,&lt;br/&gt;
James&lt;/p&gt;</comment>
                            <comment id="4400404" author="dmitry.lukyanov" created="Wed, 9 Mar 2022 12:01:51 +0000"  >&lt;p&gt;Hello &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=453532579%40qq.com&quot; class=&quot;user-hover&quot; rel=&quot;453532579@qq.com&quot;&gt;453532579@qq.com&lt;/a&gt; , thanks for your report, we will check it and come back to you.&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="10011"><![CDATA[Minor Change]]></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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>CSHARP-3615</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i05l30:</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>