<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:02:52 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-3366] ! NumberInt(0) is broken</title>
                <link>https://jira.mongodb.org/browse/SERVER-3366</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;see jstests/numberint.js&lt;/p&gt;</description>
                <environment></environment>
        <key id="19077">SERVER-3366</key>
            <summary>! NumberInt(0) is broken</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="antoine">Antoine Girbal</assignee>
                                    <reporter username="eliot">Eliot Horowitz</reporter>
                        <labels>
                    </labels>
                <created>Tue, 5 Jul 2011 06:42:01 +0000</created>
                <updated>Tue, 12 Jul 2016 00:19:53 +0000</updated>
                            <resolved>Wed, 6 Jul 2011 21:09:23 +0000</resolved>
                                                    <fixVersion>1.9.1</fixVersion>
                                    <component>JavaScript</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="40944" author="antoine" created="Wed, 6 Jul 2011 21:10:00 +0000"  >&lt;p&gt;ok I fixed the behavior in SM, see &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-854&quot; title=&quot;Way to create an integer in javascript&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-854&quot;&gt;&lt;del&gt;SERVER-854&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="40943" author="antoine" created="Wed, 6 Jul 2011 21:09:23 +0000"  >&lt;p&gt;ok I fixed the behavior in SM, see &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-854&quot; title=&quot;Way to create an integer in javascript&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-854&quot;&gt;&lt;del&gt;SERVER-854&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="40811" author="eliot" created="Wed, 6 Jul 2011 06:23:58 +0000"  >&lt;p&gt;Should do this before 1.9.1 is release as could break things in bad ways.&lt;/p&gt;</comment>
                            <comment id="40810" author="eliot" created="Wed, 6 Jul 2011 06:23:29 +0000"  >&lt;p&gt;What&apos;s really important is normal document road tripping - i.e. load modify save, and having an explicit way to create one.&lt;/p&gt;

&lt;p&gt;So I think #2 is good.&lt;/p&gt;</comment>
                            <comment id="40808" author="antoine" created="Wed, 6 Jul 2011 06:18:46 +0000"  >&lt;p&gt;the Integer is an internal C++ class.&lt;br/&gt;
when manipulating that value (say to/from json) it would not carry any information forcing it to be an integer.&lt;br/&gt;
So it would be equivalent to solution #2 above:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;ask v8 if a number is an int with isInt32(), if so serialize it to integer in BSON.&lt;/li&gt;
	&lt;li&gt;can still have explicit NumberInt method but it would just return an Integer value. No way to change toString() etc&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="40806" author="eliot" created="Wed, 6 Jul 2011 05:21:47 +0000"  >&lt;p&gt;In v8 it seems there is an Integer class?&lt;br/&gt;
Are you using that?&lt;br/&gt;
That should handle this correctly, no?&lt;/p&gt;</comment>
                            <comment id="40805" author="antoine" created="Wed, 6 Jul 2011 05:19:04 +0000"  >&lt;p&gt;I see that you assigned it to 1.9.2.&lt;br/&gt;
Do you consider not releasing 1.9.1 until it&apos;s fixed?&lt;/p&gt;

&lt;p&gt;possible solutions:&lt;br/&gt;
1) just revert back and not support explicit integer&lt;/p&gt;

&lt;p&gt;2) make the use of integer implicit.&lt;br/&gt;
When converting to bson if value is integer, would be stored as integer.&lt;br/&gt;
this is easy with v8, but again with any implicit automatic conversion there could be side effects&lt;/p&gt;

&lt;p&gt;3) use v8 and modify source to change behavior of &quot;!&quot; to call a method if an object.&lt;br/&gt;
For example it would return the value of toBoolean if exists.&lt;br/&gt;
downside is that we would be forced to use v8 and stuck with our own source.&lt;/p&gt;</comment>
                            <comment id="40804" author="eliot" created="Wed, 6 Jul 2011 04:37:00 +0000"  >&lt;p&gt;Yes - its currently breaking various unit tests, so certainly could break a lot of code in the wild with possibly disastrous consequences.&lt;/p&gt;</comment>
                            <comment id="40803" author="antoine" created="Wed, 6 Jul 2011 04:31:19 +0000"  >&lt;p&gt;I doubt it.&lt;br/&gt;
There is nothing in js standard to allow overriding this behavior, the only standard ones are toString() and valueOf() (and then equals, compareTo).&lt;br/&gt;
The only workaround is to do a toNumber()&lt;br/&gt;
SECONDARY&amp;gt; n = NumberInt(0)&lt;br/&gt;
NumberInt(0)&lt;br/&gt;
SECONDARY&amp;gt; !n.toNumber()&lt;br/&gt;
true&lt;br/&gt;
SECONDARY&amp;gt; !n&lt;br/&gt;
false&lt;/p&gt;

&lt;p&gt;what case do you think it may be an issue?&lt;br/&gt;
If someone uses an integer value as a flag and then tries to check it from JS?&lt;/p&gt;</comment>
                            <comment id="40790" author="eliot" created="Wed, 6 Jul 2011 03:02:35 +0000"  >&lt;p&gt;Is it fixable in v8?&lt;/p&gt;</comment>
                            <comment id="40723" author="antoine" created="Tue, 5 Jul 2011 21:14:43 +0000"  >&lt;p&gt;not sure that this is fixable..&lt;br/&gt;
JS considers any non null object as true it converts it to boolean.&lt;br/&gt;
I have not seen any way to change that behavior (like overloading x.asBoolean() or Boolean&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/error.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;)&lt;/p&gt;</comment>
                            <comment id="40527" author="auto" created="Tue, 5 Jul 2011 06:42:50 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;erh&apos;, u&apos;name&apos;: u&apos;Eliot Horowitz&apos;, u&apos;email&apos;: u&apos;eliot@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3366&quot; title=&quot;! NumberInt(0) is broken&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3366&quot;&gt;&lt;del&gt;SERVER-3366&lt;/del&gt;&lt;/a&gt; test&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/14688132ca56d89f2c6d45e6cac0caa6c5e91b94&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/14688132ca56d89f2c6d45e6cac0caa6c5e91b94&lt;/a&gt;&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>12.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 5 Jul 2011 06:42:50 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 years, 33 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </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>antoine</customfieldvalue>
            <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrowjb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrirwn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>23174</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|ht0f6n:</customfieldvalue>

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