<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:37:00 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-494] Support Regular Expressions for $in query builders on strings</title>
                <link>https://jira.mongodb.org/browse/CSHARP-494</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;In operators for query builders and Linq extension should take regular expressions as arguments when the operator is a string.&lt;/p&gt;



&lt;p&gt;Original report:&lt;br/&gt;
--------------------------------&lt;br/&gt;
Could you please verify if there is an option to build a linq query equivalent to the mongo query:&lt;/p&gt;

&lt;p&gt;db.Feeds.find({ShortDescription:{$in:&lt;span class=&quot;error&quot;&gt;&amp;#91;/sunil/, /raj/&amp;#93;&lt;/span&gt;}})&lt;/p&gt;

&lt;p&gt;I have tried: &lt;br/&gt;
MongoCollection&amp;lt;BsonDocument&amp;gt; feedscollection = _db.database.GetCollection&amp;lt;BsonDocument&amp;gt;(&quot;Feeds&quot;);&lt;br/&gt;
 var feeds = (from f in feedscollection.AsQueryable&amp;lt;Feeds&amp;gt;()&lt;br/&gt;
                                 select f);&lt;br/&gt;
string tags=&quot;1)Lorem ipsum sunil dolor sit amet, 2)Maecenas raj pretium laoreet nibh, 3)a rhoncus turpis cursus gravida&quot;;&lt;br/&gt;
var searchwordlist = tags.ToLower().Split(new char[] &lt;/p&gt;
{ &apos;,&apos; }
&lt;p&gt;, StringSplitOptions.RemoveEmptyEntries).Select(s =&amp;gt; string.Format(&quot;/&lt;/p&gt;
{0}
&lt;p&gt;/&quot;, s)).ToList(); &lt;br/&gt;
feeds = feeds.Where(f =&amp;gt; f.ShortDescription.In(searchwordlist));&lt;br/&gt;
//With the mongo query I am getting the first and second sentence. But when I go with the linq -&amp;gt; mongo query, I am not getting any results.&lt;/p&gt;
</description>
                <environment>CSharp Driver Linq to MongoDB</environment>
        <key id="41240">CSHARP-494</key>
            <summary>Support Regular Expressions for $in query builders on strings</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="sunilrajkg">Sunil Raj</reporter>
                        <labels>
                            <label>commands</label>
                            <label>question</label>
                    </labels>
                <created>Thu, 14 Jun 2012 10:21:11 +0000</created>
                <updated>Fri, 5 Apr 2019 13:57:42 +0000</updated>
                            <resolved>Thu, 14 Jun 2012 12:21:50 +0000</resolved>
                                    <version>1.4.2</version>
                                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="132520" author="sunilrajkg" created="Thu, 14 Jun 2012 11:46:20 +0000"  >&lt;p&gt;Answer to my own question.&lt;/p&gt;

&lt;p&gt;The PredicateBuilder in the c# driver converts the query: &lt;br/&gt;
feeds = feeds.Where(f =&amp;gt; f.ShortDescription.In(searchwordlist));&lt;/p&gt;

&lt;p&gt;to:&lt;br/&gt;
{ShortDescription:{&quot;$in&quot;:&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;/sunil/&amp;quot;, &amp;quot;/raj/&amp;quot;&amp;#93;&lt;/span&gt;}}&lt;br/&gt;
Please note the double quotes(&quot;) around the strings. These are the spoilers. This query matches for the whole string.&lt;br/&gt;
So let me put this as a feature/bug.&lt;br/&gt;
Thanks..&lt;/p&gt;</comment>
                            <comment id="132471" author="sunilrajkg" created="Thu, 14 Jun 2012 10:26:43 +0000"  >&lt;p&gt;Edit:&lt;br/&gt;
_____&lt;/p&gt;

&lt;p&gt;string tags=&quot;sunil, raj&quot;;&lt;br/&gt;
//searchwordlist has these strings as: /sunil/    /raj/&lt;br/&gt;
//Search is performed on the data:&lt;br/&gt;
1)Lorem ipsum sunil dolor sit amet&lt;br/&gt;
2)Maecenas raj pretium laoreet nibh&lt;br/&gt;
3)a rhoncus turpis cursus gravida&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="41243">CSHARP-495</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </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|hrh7fj:</customfieldvalue>

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