<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:58:38 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-21861] Better Timestamp object comparison in mongo shell</title>
                <link>https://jira.mongodb.org/browse/SERVER-21861</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;It would be great if the &amp;lt;, &amp;gt;, &amp;lt;=, &amp;gt;= operators on Timestamp objects would work as expected. The bsonWoCompare can be used for the mean time even though it will end up comparing the member functions as well as long as &apos;t&apos; fields are compared first over the &apos;i&apos; fields.&lt;/p&gt;</description>
                <environment></environment>
        <key id="243460">SERVER-21861</key>
            <summary>Better Timestamp object comparison in mongo shell</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="daniel.gottlieb@mongodb.com">Daniel Gottlieb</assignee>
                                    <reporter username="randolph@mongodb.com">Randolph Tan</reporter>
                        <labels>
                    </labels>
                <created>Fri, 11 Dec 2015 15:35:39 +0000</created>
                <updated>Wed, 9 Sep 2020 00:16:55 +0000</updated>
                            <resolved>Wed, 5 Aug 2020 02:00:07 +0000</resolved>
                                    <version>3.2.0</version>
                                    <fixVersion>4.7.0</fixVersion>
                                    <component>Shell</component>
                                        <votes>0</votes>
                                    <watches>16</watches>
                                                                                                                <comments>
                            <comment id="3321658" author="daniel.gottlieb@10gen.com" created="Wed, 5 Aug 2020 02:00:07 +0000"  >&lt;p&gt;The pushed patch offers some guard rails when using Timestamp objects. Technically, the mongo shell is unchanged. Timestamps can still be compared (i.e: &lt;tt&gt;toString&lt;/tt&gt; -ed) without an error. However, when the shell is invoked from within &lt;tt&gt;resmoke.py&lt;/tt&gt; will &lt;a href=&quot;https://github.com/mongodb/mongo/commit/1e6511738d9e0a189a2d60aabf16411de495e7d1#diff-77c0d69b4d8b291dfa796e674f629a73R428&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;inject an error&lt;/a&gt; when calling &lt;tt&gt;Timestamp.toString&lt;/tt&gt;. &lt;/p&gt;

&lt;p&gt;Most notably, this makes logging timestamps an error. The easiest path forward is to instead log `&lt;tt&gt;tojson(timestampVariable)&lt;/tt&gt;`, similar to what one would do when logging a bson object.&lt;/p&gt;</comment>
                            <comment id="3321650" author="xgen-internal-githook" created="Wed, 5 Aug 2020 01:44:10 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Daniel Gottlieb&apos;, &apos;email&apos;: &apos;daniel.gottlieb@mongodb.com&apos;, &apos;username&apos;: &apos;dgottlieb&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-21861&quot; title=&quot;Better Timestamp object comparison in mongo shell&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-21861&quot;&gt;&lt;del&gt;SERVER-21861&lt;/del&gt;&lt;/a&gt;: Prohibit Timestamp.prototype.toString via resmoke injection.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/1e6511738d9e0a189a2d60aabf16411de495e7d1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/1e6511738d9e0a189a2d60aabf16411de495e7d1&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3321649" author="xgen-internal-githook" created="Wed, 5 Aug 2020 01:44:06 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Daniel Gottlieb&apos;, &apos;email&apos;: &apos;daniel.gottlieb@mongodb.com&apos;, &apos;username&apos;: &apos;dgottlieb&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-21861&quot; title=&quot;Better Timestamp object comparison in mongo shell&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-21861&quot;&gt;&lt;del&gt;SERVER-21861&lt;/del&gt;&lt;/a&gt;: Prohibit Timestamp.prototype.toString via resmoke injection.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/10gen/mongo-enterprise-modules/commit/adf835ce81813ae09cc6bc373f4a3265706a64ff&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/10gen/mongo-enterprise-modules/commit/adf835ce81813ae09cc6bc373f4a3265706a64ff&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3285012" author="daniel.gottlieb@10gen.com" created="Tue, 14 Jul 2020 19:13:11 +0000"  >&lt;p&gt;I&apos;m going to explore the first option. I could be mistaking how change two or three would manifest, but I&apos;m worried that options which output a different timestamp string will be a problematic user change. For example, when spelunking test logs, it&apos;s common to copy a timestamp object from a server response that&apos;s output by the shell. One would no longer be able to simply paste that string as-is into a search bar for cross-referencing with server logs emitting the timestamp &amp;#8211; the server logs won&apos;t be zero-padded.&lt;/p&gt;</comment>
                            <comment id="3284857" author="robert.guo" created="Tue, 14 Jul 2020 18:06:48 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jesse&quot; class=&quot;user-hover&quot; rel=&quot;jesse&quot;&gt;jesse&lt;/a&gt; We&apos;re going to try the 1st one. Brooke&apos;s first sentence was referring to an initial idea that we later rejected.&lt;/p&gt;</comment>
                            <comment id="3284819" author="jesse" created="Tue, 14 Jul 2020 17:48:48 +0000"  >&lt;p&gt;Thanks - that seems a bit contradictory. Which suggestion are we exploring?&lt;/p&gt;</comment>
                            <comment id="3284420" author="brooke.miller" created="Tue, 14 Jul 2020 15:12:30 +0000"  >&lt;p&gt;We discussed this ticket in STM&apos;s estimation session today and individuals encouraged that we avoid the first two suggestions outlined above because resmoke.py shouldn&apos;t cover up Javascript issues in the shell. However, we discussed that the first suggestion is the best option and we should attempt that route to see how it goes and if there are fallouts.&lt;/p&gt;</comment>
                            <comment id="3279564" author="jesse" created="Fri, 10 Jul 2020 14:50:38 +0000"  >&lt;p&gt;To mitigate the pain for now, I got some ideas from &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=max.hirschhorn&quot; class=&quot;user-hover&quot; rel=&quot;max.hirschhorn&quot;&gt;max.hirschhorn&lt;/a&gt; and &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=matthew.saltz&quot; class=&quot;user-hover&quot; rel=&quot;matthew.saltz&quot;&gt;matthew.saltz&lt;/a&gt;, and I propose either:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;resmoke.py overrides Timestamp.prototype.toString at startup, to make toString throw an error. Make sure toJSON still works, and make a method toStringIncomparable that we can call in tests for output, without risking silently wrong comparisons&lt;/li&gt;
	&lt;li&gt;resmoke.py overrides Timestamp.prototype.toString at startup to make a correctly comparable representation (by left-padding its &quot;t&quot; and &quot;i&quot; numbers with a large number of zeroes)&lt;/li&gt;
	&lt;li&gt;we &lt;b&gt;always&lt;/b&gt; left-pad &quot;t&quot; and &quot;i&quot; in toString so the string is correctly comparable, at the risk of a breaking change for users (but perhaps also benefitting users who want to compare Timestamps)&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="2960350" author="brooke.miller" created="Tue, 10 Mar 2020 14:37:12 +0000"  >&lt;p&gt;Based on our conversation with the STM team during Triaging, this is something we would like to consider down the road when Javascript has better support for operator overloading.&#160;&lt;/p&gt;</comment>
                            <comment id="1311559" author="kevin.pulo@10gen.com" created="Fri, 1 Jul 2016 07:43:05 +0000"  >&lt;blockquote&gt;&lt;p&gt;We&apos;ve already added new types ... like NumberLong&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;This is the crux of the problem &amp;#8212; they&apos;re not actually &quot;Types&quot; (even though that&apos;s how we think about them), they&apos;re just Objects (to Javascript).&lt;/p&gt;</comment>
                            <comment id="1311319" author="max.hirschhorn@10gen.com" created="Thu, 30 Jun 2016 21:50:15 +0000"  >&lt;p&gt;&lt;tt&gt;NumberLong&lt;/tt&gt; instances are impacted in the same way as &lt;tt&gt;Timestamp&lt;/tt&gt; instances. The &lt;tt&gt;+&lt;/tt&gt; operator will call the &lt;tt&gt;NumberLong.prototype.valueOf()&lt;/tt&gt; function, which &lt;a href=&quot;https://github.com/mongodb/mongo/blob/r3.3.9/src/mongo/scripting/mozjs/numberlong.cpp#L72-L75&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;converts the value to a double-precision 64-bit IEEE 754 value&lt;/a&gt; because &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;that&apos;s the only number type that JavaScript really has&lt;/a&gt;.&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; NumberLong(&apos;9007199254740991&apos;) + NumberLong(&apos;9007199254740991&apos;) + NumberLong(&apos;9007199254740991&apos;)&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;27021597764222972&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; NumberLong(&apos;27021597764222973&apos;) - NumberLong(&apos;27021597764222972&apos;)&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;0&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;It seems like a risky and non-trivial amount of work to modify &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS::Value&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;the &lt;tt&gt;JS::Value&lt;/tt&gt; class in SpiderMonkey&lt;/a&gt; in order to be able to accurately represent an &lt;tt&gt;int64_t&lt;/tt&gt; type.&lt;/p&gt;</comment>
                            <comment id="1311204" author="spencer" created="Thu, 30 Jun 2016 19:53:04 +0000"  >&lt;p&gt;We&apos;ve already added new types to the mongo shell beyond what exists in pure javascript, like NumberLong.  Can we not do something similar with Timestamp?&lt;/p&gt;</comment>
                            <comment id="1310498" author="kevin.pulo@10gen.com" created="Thu, 30 Jun 2016 07:35:41 +0000"  >&lt;p&gt;It really isn&apos;t possible to do this &quot;properly&quot; (ie. &lt;tt&gt;ts1 &amp;lt; ts2&lt;/tt&gt;) without hacking the language to be Not-Quite-Javascript (&quot;MongoScript&quot;?).  See &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1672&quot; title=&quot;(new NumberLong(3754)==new NumberLong(3754)) evals to false&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1672&quot;&gt;&lt;del&gt;SERVER-1672&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Javascript simply has not been designed with any consideration for the idea that objects might want to act like native types.  Even with the above &lt;tt&gt;valueOf()&lt;/tt&gt; hack in place, &lt;tt&gt;==&lt;/tt&gt; and &lt;tt&gt;!=&lt;/tt&gt; still won&apos;t work as expected (and there is no kludge that can make them work, short of hacking the guts of the JS interpreter/JIT compiler).  This would mean that you can have &lt;tt&gt;a&lt;/tt&gt; and &lt;tt&gt;b&lt;/tt&gt; such that &lt;tt&gt;a &amp;gt;= b &amp;amp;&amp;amp; a &amp;lt;= b&lt;/tt&gt;, yet &lt;tt&gt;a != b&lt;/tt&gt;, which is arguably worse.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.slideshare.net/BrendanEich/value-objects2&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Value objects&lt;/a&gt; are likely to be able to address this, but they are currently a long way from being in an ES standard.&lt;/p&gt;

&lt;p&gt;The only real option is to have ugly comparison methods and use them everywhere, eg. &lt;tt&gt;ts1.eq(ts2)&lt;/tt&gt;, &lt;tt&gt;ts1.lte(ts2)&lt;/tt&gt;.  But there&apos;s still no way of prohibiting a jstest or user from accidentally doing &lt;tt&gt;ts1 == ts2&lt;/tt&gt; or &lt;tt&gt;ts1 &amp;lt;= ts2&lt;/tt&gt;.&lt;/p&gt;</comment>
                            <comment id="1297290" author="spencer" created="Thu, 16 Jun 2016 22:08:41 +0000"  >&lt;p&gt;Is there no way to make the comparison happen in C++ rather than javascript, where it could do the right thing?&lt;/p&gt;

&lt;p&gt;I just wasted a full day diagnosing a build failure that turned out to be a direct result of this.  I filed &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-24628&quot; title=&quot;ReplSetTest.awaitLastOpCommitted can fail to wait for the last op to be committed&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-24628&quot;&gt;&lt;del&gt;SERVER-24628&lt;/del&gt;&lt;/a&gt; for fixing this specific instance where we&apos;re incorrectly relying on Timestamp comparisons, but it would be great to do something to prevent issues like that from coming up again in the future.&lt;/p&gt;</comment>
                            <comment id="1124647" author="kevin.pulo@10gen.com" created="Fri, 1 Jan 2016 04:16:25 +0000"  >&lt;p&gt;A simpler, easier alternative is to make Timestamp&apos;s &lt;tt&gt;valueOf()&lt;/tt&gt; return a string representation that has the necessary lexicographic order.  Sufficient is to zero-pad the numbers, since they are fixed precision 32 bit ints.  And use hex to make them be a bit shorter, but still readable.&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; Timestamp(1,900) &amp;lt; Timestamp(1,99)&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;true&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; Timestamp.prototype.valueOf = function() { return &quot;Timestamp(0x&quot; + this.t.toString(16).pad(8, false, &quot;0&quot;) + &quot;, 0x&quot; + this.i.toString(16).pad(8, false, &quot;0&quot;) + &quot;)&quot;; }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;function () { return &quot;Timestamp(0x&quot; + this.t.toString(16).pad(8, false, &quot;0&quot;) + &quot;, 0x&quot; + this.i.toString(16).pad(8, false, &quot;0&quot;) + &quot;)&quot;; }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; Timestamp(1,900) &amp;lt; Timestamp(1,99)&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;false&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;Converting to and comparing strings is a bit slow, but the implicit conversion is doing that already anyway.  This way is only slightly slower (the strings are always 33 bytes long, rather than 15 to 33 bytes), but has the significant advantage of being correct in all cases &amp;#8212; instead of often right but sometimes silently wrong.&lt;/p&gt;

&lt;p&gt;This also has the nice upshot of allowing the standard assert helpers (&lt;tt&gt;assert.lt&lt;/tt&gt;, etc) to continue working without modification, thereby obviating &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-21941&quot; title=&quot;Automatically handle Timestamp comparisons in assert helpers&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-21941&quot;&gt;&lt;del&gt;SERVER-21941&lt;/del&gt;&lt;/a&gt; (cc &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=kamran.khan&quot; class=&quot;user-hover&quot; rel=&quot;kamran.khan&quot;&gt;kamran.khan&lt;/a&gt;).&lt;/p&gt;</comment>
                            <comment id="1112409" author="max.hirschhorn@10gen.com" created="Fri, 11 Dec 2015 19:24:50 +0000"  >&lt;p&gt;I don&apos;t think it&apos;s possible to have &lt;tt&gt;&amp;lt;&lt;/tt&gt;, &lt;tt&gt;&amp;gt;&lt;/tt&gt;, &lt;tt&gt;&amp;lt;=&lt;/tt&gt;, and &lt;tt&gt;&amp;gt;=&lt;/tt&gt; work as expected for all &lt;tt&gt;Timestamp&lt;/tt&gt; instances. &lt;tt&gt;Timestamp&lt;/tt&gt; instances are converted to strings when compared using relational operators. We could change &lt;tt&gt;Timestamp.prototype.valueOf()&lt;/tt&gt; to convert them to a &lt;tt&gt;Number&lt;/tt&gt; instance as follows:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;Timestamp.prototype.valueOf = &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;() {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; high = &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;.getTime() &amp;gt;&amp;gt;&amp;gt; 0;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; low = &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;.getInc() &amp;gt;&amp;gt;&amp;gt; 0;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; high * 0x100000000 + low;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;However, that only gives us 21 bits to use from &lt;tt&gt;high&lt;/tt&gt; before we&apos;d exceed &lt;tt&gt;Number.MAX_SAFE_INTEGER&lt;/tt&gt;, which is insufficient for representing the number of seconds that have elapsed since the Unix epoch.&lt;/p&gt;

&lt;p&gt;Using &lt;tt&gt;bsonWoCompare()&lt;/tt&gt; would provide a complete solution because a similar issue also affects large &lt;tt&gt;NumberLong&lt;/tt&gt; instances. We could even define &lt;tt&gt;Timestamp.prototype.compare(other)&lt;/tt&gt;, etc. functions for convenience.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="434731">SERVER-31301</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1406296">SERVER-49422</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="294583">SERVER-24628</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="12899">SERVER-1672</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="244439">SERVER-21941</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>16.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_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10011"><![CDATA[Minor Change]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 11 Dec 2015 19:24:50 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 27 weeks, 1 day 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_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></customfieldvalue>

                        </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>steven.vannelli@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 27 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>16.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>jesse@mongodb.com</customfieldvalue>
            <customfieldvalue>brooke.miller@mongodb.com</customfieldvalue>
            <customfieldvalue>daniel.gottlieb@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>kevin.pulo@mongodb.com</customfieldvalue>
            <customfieldvalue>max.hirschhorn@mongodb.com</customfieldvalue>
            <customfieldvalue>randolph@mongodb.com</customfieldvalue>
            <customfieldvalue>robert.guo@mongodb.com</customfieldvalue>
            <customfieldvalue>spencer@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrkmfr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr9jjz:</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="3965">STM 2020-08-10</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10555" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</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|hrkzp3:</customfieldvalue>

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