<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:52:44 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>[JAVA-634] BSONTimestamp loses precision</title>
                <link>https://jira.mongodb.org/browse/JAVA-634</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;For a reason unfathomable to me, the API for BSONTimestamp uses seconds, both for the constructor and for getTime(), even though the actual BSON type is in milliseconds. Since the type is an integer, this means that any millisecond precision is lost in the Java driver.&lt;/p&gt;

&lt;p&gt;Please fix this to use milliseconds!&lt;/p&gt;

&lt;p&gt;For backwards API compatibility, I suggest the following:&lt;/p&gt;

&lt;p&gt;1. A second constructor: BSONTimestamp(int t, int i, boolean isMilliseconds) - the old constructor would just call this with isMilliseconds=false&lt;br/&gt;
2. Leave getTime as it is, but add getTimeMilliseconds which will return the time without dividing by 1000&lt;/p&gt;</description>
                <environment></environment>
        <key id="48580">JAVA-634</key>
            <summary>BSONTimestamp loses precision</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="9">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="tal.liron">Tal Liron</reporter>
                        <labels>
                    </labels>
                <created>Wed, 29 Aug 2012 20:53:00 +0000</created>
                <updated>Thu, 30 Aug 2012 01:39:31 +0000</updated>
                            <resolved>Wed, 29 Aug 2012 21:47:34 +0000</resolved>
                                    <version>2.9.0</version>
                                                    <component>API</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="158270" author="tal.liron" created="Wed, 29 Aug 2012 21:50:05 +0000"  >&lt;p&gt;Many thanks, and glad I contributed to a clarification.&lt;/p&gt;

&lt;p&gt;I will update the code for the Rhino JavaScript driver (which I maintain) to reflect this, as it currently uses milliseconds.&lt;/p&gt;</comment>
                            <comment id="158268" author="scotthernandez" created="Wed, 29 Aug 2012 21:47:34 +0000"  >&lt;p&gt;The extended json docs were wrong. Now fixed. We have no plans to extent the type, or change it in the immediate future.&lt;/p&gt;</comment>
                            <comment id="158250" author="tal.liron" created="Wed, 29 Aug 2012 21:11:07 +0000"  >&lt;p&gt;Oh, interesting, I was looking at the extended JSON spec for $timestamp where it mentions that &quot;i&quot; is a 32-bit integer measured in milliseconds. I guess this is just in preparation for a future improvement in precision?&lt;/p&gt;

&lt;p&gt;If so, it might be nice to have the Java driver also prepare the future by allowing the APIs I mentioned, even though no precision is lost. That way code that relies on it will gain this benefit in the future.&lt;/p&gt;</comment>
                            <comment id="158243" author="scotthernandez" created="Wed, 29 Aug 2012 21:03:56 +0000"  >&lt;p&gt;The bson timestamp is 8 bytes where 4bytes are in seconds and 4bytes are a counter. It is not stored in milliseconds.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://bsonspec.org/#/specification&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://bsonspec.org/#/specification&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrghfr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9763</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>