<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:38:03 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-862] Regex Queries /s suffix</title>
                <link>https://jira.mongodb.org/browse/CSHARP-862</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;You&apos;ve used an s suffix for the regex clauses and i think because of that suffix index selection and profile output is not working correctly. You can not use find() for profile collection because it gives an error message about s suffix.&lt;/p&gt;

&lt;p&gt;var options = caseInsensitive ? &quot;is&quot; : &quot;s&quot;;&lt;/p&gt;

&lt;p&gt;When i change the above line with &lt;/p&gt;

&lt;p&gt;var options = caseInsensitive ? &quot;i&quot; : &quot;&quot;;  &lt;/p&gt;

&lt;p&gt;line, everything is going well. &lt;/p&gt;

&lt;p&gt;But is there a reason for that &quot;s&quot; suffix.&lt;/p&gt;</description>
                <environment></environment>
        <key id="98429">CSHARP-862</key>
            <summary>Regex Queries /s suffix</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="-1">Unassigned</assignee>
                                    <reporter username="hyurtseven@dogantv.com.tr">Huseyin Yurtseven</reporter>
                        <labels>
                            <label>question</label>
                    </labels>
                <created>Thu, 14 Nov 2013 14:40:21 +0000</created>
                <updated>Fri, 5 Apr 2019 13:59:16 +0000</updated>
                            <resolved>Thu, 14 Nov 2013 22:11:52 +0000</resolved>
                                    <version>1.8.3</version>
                                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="456483" author="hyurtseven@dogantv.com.tr" created="Thu, 14 Nov 2013 22:08:23 +0000"  >&lt;p&gt;Thank for your helps. You&apos;re right if you change the driver behaviour someone&apos;s code would not work.&lt;/p&gt;

&lt;p&gt;So i will be waiting for server and shell issues.&lt;/p&gt;

&lt;p&gt;Thanks again.&lt;/p&gt;
</comment>
                            <comment id="456470" author="craiggwilson" created="Thu, 14 Nov 2013 21:58:02 +0000"  >&lt;p&gt;Ok, figured out what is going on.  I&apos;ve linked &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4645&quot; title=&quot;The shell&amp;#39;s db.collection.find() command asserts on regexs that the shell can&amp;#39;t execute&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-4645&quot;&gt;&lt;del&gt;SERVER-4645&lt;/del&gt;&lt;/a&gt; as this appears to be a server issue.  /s is a legal suffix, but the shell simply doesn&apos;t recognize it.  Hence, when querying from the profile collection in the shell, there is an issue loading up queries that contained this suffix.   However, it is entirely possible to query the system.profile collection from the .NET driver, and likely any other driver.  It truly is a shell issue.  I&apos;ve also linked &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9035&quot; title=&quot;Regex &amp;quot;s&amp;quot; option causes mongo to use slow query plan&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9035&quot;&gt;&lt;del&gt;SERVER-9035&lt;/del&gt;&lt;/a&gt; which indicates a performance issue with the /s flag.  &lt;/p&gt;

&lt;p&gt;Unfortunately, there really isn&apos;t a whole lot we, the .NET driver team, can do at this point.  If we remove the /s option from LINQ queries, we&apos;ll likely break someone who was relying on the behavior.  However, there is a workaround for you.  Instead of using StartsWith, you can use Regex.IsMatch(input, pattern, RegexOptions.None).  Basically, as long as you do NOT include RegexOptions.SingleLine, then the s will not get included as a suffix.&lt;/p&gt;

&lt;p&gt;Sorry it took me this long to figure out what was going on.  As far as this ticket is concerned, I don&apos;t think there is any work to be done in the driver, so I&apos;d like to close it.  Let me know if that is ok or if there is anything else I can do to help in regards to this issue.&lt;/p&gt;</comment>
                            <comment id="456451" author="hyurtseven@dogantv.com.tr" created="Thu, 14 Nov 2013 21:35:30 +0000"  >&lt;p&gt;Yes i&apos;m referring to the system.profile collection. I&apos;m using mongodb 2.2 version  and  i&apos;m not sure but after remove that /s option my query&apos;s response time decreased. &lt;/p&gt;</comment>
                            <comment id="456449" author="craiggwilson" created="Thu, 14 Nov 2013 21:31:21 +0000"  >&lt;p&gt;Are you referring to the system.profile collection (&lt;a href=&quot;http://docs.mongodb.org/manual/tutorial/manage-the-database-profiler/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://docs.mongodb.org/manual/tutorial/manage-the-database-profiler/&lt;/a&gt;) or some other collection?  If some other collection, could you please provide some sample documents?  &lt;/p&gt;

&lt;p&gt;Also, what version of MongoDB are you using?&lt;/p&gt;</comment>
                            <comment id="456442" author="hyurtseven@dogantv.com.tr" created="Thu, 14 Nov 2013 21:29:02 +0000"  >&lt;p&gt;Actually i use Linq startswith and mongo driver always put /s option and because of this s option i cannot look into profile collection, it gives an error about s option and i cannot use /s option on mongo shell it gives an error as well. That&apos;s why i wanted to ask.&lt;/p&gt;

&lt;p&gt;Thank you.&lt;/p&gt;</comment>
                            <comment id="456358" author="craiggwilson" created="Thu, 14 Nov 2013 19:49:43 +0000"  >&lt;p&gt;Perhaps you could show the regular expression you are using.  The s suffix allows the &apos;.&apos; character to match newline characters as documented here: &lt;a href=&quot;http://docs.mongodb.org/manual/reference/operator/query/regex/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://docs.mongodb.org/manual/reference/operator/query/regex/&lt;/a&gt;. &lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="27893">SERVER-4645</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="69138">SERVER-9035</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <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|hru7gn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>90179</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>