<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:20:22 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-29269] Issue with the &quot;$gt and $lt&quot; options in Aggregation Pipeline</title>
                <link>https://jira.mongodb.org/browse/SERVER-29269</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;My collection containes documents as follow:&lt;br/&gt;
*****************************************************************&lt;br/&gt;
/* 1 */&lt;/p&gt;
{
    &quot;_id&quot; : ObjectId(&quot;591dae6ae320467808f1e198&quot;),
    &quot;scenario&quot; : &quot;delc&quot;,
    &quot;datavalue&quot; : [ 
        &quot; _value: &quot;, 
        &quot;A _value: 8&quot;, 
        &quot;B _value: 5&quot;, 
        &quot;C _value: 2&quot;, 
        &quot;D _value:4&quot;
    ]
}

&lt;p&gt;/* 2 */&lt;/p&gt;
{
    &quot;_id&quot; : ObjectId(&quot;591dae83e320467808f1e199&quot;),
    &quot;scenario&quot; : &quot;delc&quot;,
    &quot;datavalue&quot; : [ 
        &quot; _value: &quot;, 
        &quot;A _value: 4&quot;, 
        &quot;B _value: 5&quot;, 
        &quot;C _value: 92&quot;, 
        &quot;D _value:94&quot;
    ]
}

&lt;p&gt;/* 3 */&lt;/p&gt;
{
    &quot;_id&quot; : ObjectId(&quot;591dae9ae320467808f1e19a&quot;),
    &quot;scenario&quot; : &quot;delc&quot;,
    &quot;datavalue&quot; : [ 
        &quot; _value: &quot;, 
        &quot;A _value: 2&quot;, 
        &quot;C _value: 2&quot;, 
        &quot;D _value:4&quot;
    ]
}
&lt;p&gt;**********************************************************************&lt;/p&gt;

&lt;p&gt;When I want to search for &quot;datavalue grater than A _value: 6&quot; it does not work (returns all the documents) with simple $match $project as follow : &lt;br/&gt;
*************************************************&lt;br/&gt;
db.getCollection(&apos;test&apos;).aggregate([&lt;br/&gt;
{$match : {datavalue : &lt;/p&gt;
{ $gt : &apos;A _value: 6&apos;}
&lt;p&gt;}},&lt;br/&gt;
 { $project: { scenario: 1, &lt;br/&gt;
     datavalue: { $filter: { input: &quot;$datavalue&quot;, as: &quot;datavalue&quot;,&lt;br/&gt;
         cond: { &lt;br/&gt;
     $or: [ { $eq: [ &lt;/p&gt;
{ $substr: [ &quot;$$datavalue&quot;, 0, 1 ] }
&lt;p&gt;, &quot;A&quot; ] } ] } } }&lt;br/&gt;
} }])&lt;br/&gt;
*************************************************&lt;br/&gt;
If I add another $match (the same as the first one) to the pipeline the results are OK, but if I add a condition &quot;searching for documents with datavalue grater than A _value: 6 and datavalue starts with B&quot; it returns all the documents (I attached an image)&lt;/p&gt;
</description>
                <environment></environment>
        <key id="384732">SERVER-29269</key>
            <summary>Issue with the &quot;$gt and $lt&quot; options in Aggregation Pipeline</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="Marwa FRIAA">Marwa FRIAA [X]</reporter>
                        <labels>
                    </labels>
                <created>Thu, 18 May 2017 14:39:43 +0000</created>
                <updated>Fri, 19 May 2017 03:40:40 +0000</updated>
                            <resolved>Fri, 19 May 2017 03:40:40 +0000</resolved>
                                    <version>3.2.11</version>
                                                    <component>Aggregation Framework</component>
                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="1575100" author="thomas.schubert" created="Fri, 19 May 2017 03:40:40 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=Marwa+FRIAA&quot; class=&quot;user-hover&quot; rel=&quot;Marwa FRIAA&quot;&gt;Marwa FRIAA&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;This is the expected behavior since the query is looking for an array that has values greater than &quot;A_value: 6&quot; (which is a string). Please note that the string &quot;B_value&quot; is greater than the string &quot;A_value...&quot;.&lt;/p&gt;

&lt;p&gt;As I mentioned earlier, for MongoDB-related support discussion please post on the &lt;a href=&quot;http://groups.google.com/group/mongodb-user&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb-user group&lt;/a&gt; or &lt;a href=&quot;http://stackoverflow.com/questions/tagged/mongodb&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Stack Overflow with the &lt;tt&gt;mongodb&lt;/tt&gt; tag&lt;/a&gt;. A question like this involving more discussion would be best posted on the mongodb-users group.&lt;/p&gt;

&lt;p&gt;See also our &lt;a href=&quot;https://docs.mongodb.org/manual/support&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Technical Support page&lt;/a&gt; for additional support resources.&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
Thomas&lt;/p&gt;</comment>
                            <comment id="1574466" author="marwa friaa" created="Thu, 18 May 2017 14:43:32 +0000"  >&lt;p&gt;But it works with $lt in other examples it works with $gt and not $lt . I don&apos;t understand why ..&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="156408" name="Capture.PNG" size="34635" author="Marwa FRIAA" created="Thu, 18 May 2017 14:38:01 +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>Thu, 18 May 2017 20:53:42 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        6 years, 38 weeks, 6 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>kelsey.schubert@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            6 years, 38 weeks, 6 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>kelsey.schubert@mongodb.com</customfieldvalue>
            <customfieldvalue>Marwa FRIAA</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|ht7mrb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hszri7:</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_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|ht48hj:</customfieldvalue>

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