<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:36: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>[SERVER-55286] $regex operator inside a Spring Boot @Query annotation unsuccessful </title>
                <link>https://jira.mongodb.org/browse/SERVER-55286</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Hello,&lt;/p&gt;

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

&lt;p&gt;I have spent hours trying to successfully submit a $regex driven query using the Java Spring Boot @Query annotation. I also tried with the generated query methods based on names, however, still nothing.&lt;/p&gt;

&lt;p&gt;I have already searched in the documentation and throughout the Internet, but I could not identify my mistake. Could anyone back me up on this one?&lt;/p&gt;

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

&lt;p&gt;Regards,&lt;/p&gt;

&lt;p&gt;Pavel Antonov&lt;/p&gt;</description>
                <environment></environment>
        <key id="1652476">SERVER-55286</key>
            <summary>$regex operator inside a Spring Boot @Query annotation unsuccessful </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="-1">Unassigned</assignee>
                                    <reporter username="paveldushev9@gmail.com">Pavel Antonov</reporter>
                        <labels>
                    </labels>
                <created>Thu, 18 Mar 2021 10:45:31 +0000</created>
                <updated>Fri, 19 Mar 2021 22:19:14 +0000</updated>
                            <resolved>Fri, 19 Mar 2021 22:19:14 +0000</resolved>
                                                                    <component>Querying</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="3674695" author="eric.sedor" created="Fri, 19 Mar 2021 22:18:54 +0000"  >&lt;p&gt;Glad to hear you found the issue &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=paveldushev9%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;paveldushev9@gmail.com&quot;&gt;paveldushev9@gmail.com&lt;/a&gt;, thanks for updating us. In the future, if you&apos;re having a problem but don&apos;t yet suspect a bug in the MongoDB core server itself, we tend to recommend asking our community for help by posting on the &lt;a href=&quot;https://community.mongodb.com&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;MongoDB Developer Community Forums&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If the discussion there leads you to suspect a bug in the MongoDB server, then we&apos;d want to discuss here in the SERVER project.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Eric&lt;/p&gt;</comment>
                            <comment id="3673445" author="JIRAUSER1258960" created="Fri, 19 Mar 2021 14:28:43 +0000"  >&lt;p&gt;There was actually a hidden issue in my back-end. Everything works as expected.&lt;/p&gt;

&lt;p&gt;Feel free to delete the ticket.&lt;/p&gt;

&lt;p&gt;Sorry for bothering!&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="305452" name="image-2021-03-18-11-24-43-968.png" size="18317" author="paveldushev9@gmail.com" created="Thu, 18 Mar 2021 10:24:46 +0000"/>
                            <attachment id="305451" name="image-2021-03-18-11-38-16-718.png" size="25598" author="paveldushev9@gmail.com" created="Thu, 18 Mar 2021 10:38:18 +0000"/>
                            <attachment id="305450" name="image-2021-03-18-11-39-03-720.png" size="32382" author="paveldushev9@gmail.com" created="Thu, 18 Mar 2021 10:39:05 +0000"/>
                            <attachment id="305449" name="image-2021-03-18-11-39-20-866.png" size="33598" author="paveldushev9@gmail.com" created="Thu, 18 Mar 2021 10:39:22 +0000"/>
                            <attachment id="305448" name="image-2021-03-18-11-39-24-832.png" size="33410" author="paveldushev9@gmail.com" created="Thu, 18 Mar 2021 10:39:26 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 19 Mar 2021 22:18:54 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 46 weeks, 5 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></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_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>eric.sedor@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 46 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>eric.sedor@mongodb.com</customfieldvalue>
            <customfieldvalue>paveldushev9@gmail.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hz02xz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hyla3b:</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>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;I would like to retrieve every document with a patchName(String), which contains a given phrase. E.g. &quot;When the user submits a keyword &quot;S2A&quot;, he will acquire all matching documents with patch names i.e., &quot;patchName&quot; : &quot;S2A_MSIL2A_20170613T101031_0_64&quot;. Since I would like that the phrase is contained into the patch name, I decided to go with $regex, since a text index searches only exact phrases. I managed it to submit the query in the mongodb shell, however, I am not able to reproduce it inside the Spring Boot Repository class at server-side. Hereby I attach some screenshots:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/attachment/305452/305452_image-2021-03-18-11-24-43-968.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;/p&gt;

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

&lt;p&gt;And here is the analogous query, submitted from Spring Boot Repository class:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/attachment/305451/305451_image-2021-03-18-11-38-16-718.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;/p&gt;

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

&lt;p&gt;And this is how I invoke it (p.s. I tried several approaches, but still nothing):&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/attachment/305450/305450_image-2021-03-18-11-39-03-720.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/attachment/305449/305449_image-2021-03-18-11-39-20-866.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/attachment/305448/305448_image-2021-03-18-11-39-24-832.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Whichever approach I take, it still does not work. Even if I submit the exact patch name of the document, it does not retrieve it.&lt;/p&gt;

&lt;p&gt;Hereby I provide you with two example documents (the data originates from the BigEarthNet archive (&lt;a href=&quot;http://bigearth.net/):&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://bigearth.net/):&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
 &quot;_id&quot; : ObjectId(&quot;60531c9be17ae9783919549b&quot;),&lt;br/&gt;
 &quot;type&quot; : &quot;Feature&quot;,&lt;br/&gt;
 &quot;location&quot; : [&lt;br/&gt;
 [&lt;br/&gt;
 20.9996003792675,&lt;br/&gt;
 63.3486882292739&lt;br/&gt;
 ],&lt;br/&gt;
 [&lt;br/&gt;
 20.9996003792675,&lt;br/&gt;
 63.3379164659186&lt;br/&gt;
 ],&lt;br/&gt;
 [&lt;br/&gt;
 21.0235688072459,&lt;br/&gt;
 63.3379164659186&lt;br/&gt;
 ],&lt;br/&gt;
 [&lt;br/&gt;
 21.0235688072459,&lt;br/&gt;
 63.3486882292739&lt;br/&gt;
 ],&lt;br/&gt;
 [&lt;br/&gt;
 20.9996003792675,&lt;br/&gt;
 63.3486882292739&lt;br/&gt;
 ]&lt;br/&gt;
 ],&lt;br/&gt;
 &quot;properties&quot; : &lt;/p&gt;
{
 &quot;patchName&quot; : &quot;S2A_MSIL2A_20170613T101031_0_63&quot;,
 &quot;labels&quot; : [
 &quot;f&quot;
 ],
 &quot;acquisitionDate&quot; : ISODate(&quot;2017-01-13T09:10:31Z&quot;)
 }
&lt;p&gt;,&lt;br/&gt;
 &quot;_class&quot; : &quot;com.tuberlin.dbpro.models.database.MetaJson&quot;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
 &quot;_id&quot; : ObjectId(&quot;60531c9be17ae9783919549c&quot;),&lt;br/&gt;
 &quot;type&quot; : &quot;Feature&quot;,&lt;br/&gt;
 &quot;location&quot; : [&lt;br/&gt;
 [&lt;br/&gt;
 20.9996005286705,&lt;br/&gt;
 63.3379184119332&lt;br/&gt;
 ],&lt;br/&gt;
 [&lt;br/&gt;
 20.9996005286705,&lt;br/&gt;
 63.3271466330944&lt;br/&gt;
 ],&lt;br/&gt;
 [&lt;br/&gt;
 21.0235599998921,&lt;br/&gt;
 63.3271466330944&lt;br/&gt;
 ],&lt;br/&gt;
 [&lt;br/&gt;
 21.0235599998921,&lt;br/&gt;
 63.3379184119332&lt;br/&gt;
 ],&lt;br/&gt;
 [&lt;br/&gt;
 20.9996005286705,&lt;br/&gt;
 63.3379184119332&lt;br/&gt;
 ]&lt;br/&gt;
 ],&lt;br/&gt;
 &quot;properties&quot; : &lt;/p&gt;
{
 &quot;patchName&quot; : &quot;S2A_MSIL2A_20170613T101031_0_64&quot;,
 &quot;labels&quot; : [
 &quot;f&quot;
 ],
 &quot;acquisitionDate&quot; : ISODate(&quot;2017-01-13T09:10:31Z&quot;)
 }
&lt;p&gt;,&lt;br/&gt;
 &quot;_class&quot; : &quot;com.tuberlin.dbpro.models.database.MetaJson&quot;&lt;br/&gt;
}&lt;/p&gt;

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

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

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

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

&lt;p&gt;&#160;&lt;/p&gt;</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hyzp73:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>