<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:28:09 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-31773] BSONObj comparison</title>
                <link>https://jira.mongodb.org/browse/SERVER-31773</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The DeferredComparison for BSONObj uses BSONObj::woCompare&lt;br/&gt;
In turn, it compares BSONElements using explicitly BSONElement::woCompare&lt;/p&gt;

&lt;p&gt;This misses the opportunity to use the DeferredComparison of BSONElement for overloaded comparison operators.&lt;/p&gt;

&lt;p&gt;Although this is a strong constraint in the current implementation, this does not allow to specify a different BSONElement comparison implementaton using the DeferredComparison mechanism that could be used instead.&lt;/p&gt;

&lt;p&gt;Potential usage: implicit type conversion&lt;/p&gt;</description>
                <environment></environment>
        <key id="453276">SERVER-31773</key>
            <summary>BSONObj comparison</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="david.storch@mongodb.com">David Storch</assignee>
                                    <reporter username="Uyttendaele">Simon</reporter>
                        <labels>
                    </labels>
                <created>Tue, 31 Oct 2017 14:37:03 +0000</created>
                <updated>Fri, 3 Nov 2017 21:24:41 +0000</updated>
                            <resolved>Fri, 3 Nov 2017 19:03:15 +0000</resolved>
                                                                    <component>Internal Code</component>
                    <component>Querying</component>
                                        <votes>0</votes>
                                    <watches>10</watches>
                                                                                                                <comments>
                            <comment id="1716971" author="david.storch" created="Fri, 3 Nov 2017 21:24:41 +0000"  >&lt;p&gt;I see, thanks for the additional detail. Yes, we could change the various implementations of &lt;tt&gt;BSONObj::ComparatorInterface::compare()&lt;/tt&gt; to use &lt;tt&gt;BSONElement::ComparatorInterface&lt;/tt&gt;, though you&apos;re right that we would have to do something to avoid code duplication with &lt;tt&gt;BSONObj::woCompare()&lt;/tt&gt;. This is not something we&apos;re planning to pursue in the near future, however.&lt;/p&gt;

&lt;p&gt;Best,&lt;br/&gt;
Dave&lt;/p&gt;</comment>
                            <comment id="1716945" author="uyttendaele" created="Fri, 3 Nov 2017 20:48:43 +0000"  >&lt;p&gt;Hello David&lt;/p&gt;

&lt;p&gt;The fact that &lt;tt&gt;woCompare()&lt;/tt&gt; exists shows that there are several comparison modes possible between objects (whether BSONObj, BSONElement or else).&lt;/p&gt;

&lt;p&gt;For a consistence point of view, in my opinion, it would make sense that &lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;tt&gt;BSONObj::woCompare()&lt;/tt&gt; make use of &lt;tt&gt;BSONElement::woCompare()&lt;/tt&gt;.&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;BSONObj operator&amp;lt;&lt;/tt&gt; (operator overload) make use of &lt;tt&gt;BSONElement operator&amp;lt;&lt;/tt&gt;&lt;/li&gt;
	&lt;li&gt;and that the &lt;tt&gt;BSONObj::ComparatorInterface&lt;/tt&gt; make use of &lt;tt&gt;BSONElement::ComparatorInterface&lt;/tt&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The fact that the current implementation all use &lt;tt&gt;woCompare()&lt;/tt&gt; under the hood should not imply that shortcuts are taken and that &lt;tt&gt;BSONObj operator&amp;lt;&lt;/tt&gt; use directly &lt;tt&gt;BSONElement::woCompare()&lt;/tt&gt; for instance (that is not currently the case, this is for exemple only).&lt;/p&gt;

&lt;p&gt;Although this means probably duplicating some comparison code at this time (because they all currently use &lt;tt&gt;woCompare()&lt;/tt&gt;), this would allow for a more modular and fine-tuned comparison logic.&lt;/p&gt;

&lt;p&gt;If &lt;tt&gt;woCompare()&lt;/tt&gt; is always the desired comparison mode, why not always call it explicitely ?&lt;/p&gt;

&lt;p&gt;Meanwhile, I understand that this ticket is not about a bug and that it does not bring direct new functionalities considering the amount of rework it may imply and intensive regression tests so it is Ok with me as &quot;Won&apos;t Fix&quot; even though I believe it could bring a valuable improvement to the consistency and reliability of the internal code.&lt;/p&gt;</comment>
                            <comment id="1716837" author="david.storch" created="Fri, 3 Nov 2017 19:02:28 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=Uyttendaele&quot; class=&quot;user-hover&quot; rel=&quot;Uyttendaele&quot;&gt;Uyttendaele&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;If I understand correctly, you are suggesting a pure refactor in which we change &lt;tt&gt;BSONObj::woCompare()&lt;/tt&gt; to be implemented in terms of the &lt;tt&gt;BSONElement::ComparatorInterface&lt;/tt&gt;. While this is certainly an interesting idea, the MongoDB query engineering team does not see the value in pursuing this refactor right now. It is certainly the case that we could implement many interesting &lt;tt&gt;BSONObj&lt;/tt&gt; or &lt;tt&gt;BSONElement&lt;/tt&gt; comparators, such as those that can compare with implicit type conversion. However, this work seems separate from the pure refactor you suggest.&lt;/p&gt;

&lt;p&gt;I am closing this ticket as Won&apos;t Fix. Please let me know if we misunderstood something, or if you have a more compelling reason for why our engineering team should consider this work. And thanks for your interest in MongoDB---several of the SERVER tickets you filed recently contain insightful observations!&lt;/p&gt;

&lt;p&gt;Best,&lt;br/&gt;
Dave&lt;/p&gt;</comment>
                            <comment id="1713638" author="mark.agarunov" created="Tue, 31 Oct 2017 16:23:39 +0000"  >&lt;p&gt;Hello &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=Uyttendaele&quot; class=&quot;user-hover&quot; rel=&quot;Uyttendaele&quot;&gt;Uyttendaele&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thank you for the detailed description of this behavior. I&apos;ve set the fixVersion to &quot;Needs Triage&quot; for this new feature to be scheduled against our currently planned work. Updates will be posted on this ticket as they are available.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Mark&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 31 Oct 2017 16:23:39 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            6 years, 14 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>mark.agarunov</customfieldvalue>
            <customfieldvalue>Uyttendaele</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htj2i7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htaumn:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="1952">Query 2017-11-13</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|htiolz:</customfieldvalue>

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