<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:55:41 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-1858] Clarify deprecation of DB in 3.x</title>
                <link>https://jira.mongodb.org/browse/JAVA-1858</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;I&apos;m quite confused as to whether DB is deprecated in favor of MongoDatabase. I see that Mongo.getDB is deprecated, but DB itself is not. It&apos;s quite confusing and duplicative to have both DB and a MongoDatabase. I think the answer is that one of them is deprecated. However, it hasn&apos;t been deprecated in the code and in fact my entire code base compiles fine without a single deprecation warning.&lt;/p&gt;</description>
                <environment></environment>
        <key id="209929">JAVA-1858</key>
            <summary>Clarify deprecation of DB in 3.x</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="jeff.yemin@mongodb.com">Jeffrey Yemin</assignee>
                                    <reporter username="chengas123">Ben McCann</reporter>
                        <labels>
                    </labels>
                <created>Thu, 11 Jun 2015 05:36:42 +0000</created>
                <updated>Wed, 7 Oct 2015 13:00:58 +0000</updated>
                            <resolved>Fri, 4 Sep 2015 13:03:43 +0000</resolved>
                                                    <fixVersion>3.1.0</fixVersion>
                                    <component>API</component>
                    <component>Documentation</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="1053699" author="jeff.yemin" created="Wed, 7 Oct 2015 13:00:58 +0000"  >&lt;p&gt;Released in &lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/releases/tag/r3.1.0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;3.1.0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1022467" author="xgen-internal-githook" created="Fri, 4 Sep 2015 13:00:14 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;jyemin&apos;, u&apos;name&apos;: u&apos;Jeff Yemin&apos;, u&apos;email&apos;: u&apos;jeff.yemin@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-1858&quot; title=&quot;Clarify deprecation of DB in 3.x&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-1858&quot;&gt;&lt;del&gt;JAVA-1858&lt;/del&gt;&lt;/a&gt;: Clarified effective deprecation of DB, DBCollection, and DBCursor.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/487c04fd446932be07dfbf23cc37d54e14dc90fd&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/487c04fd446932be07dfbf23cc37d54e14dc90fd&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="938890" author="ross@10gen.com" created="Fri, 12 Jun 2015 14:28:33 +0000"  >&lt;p&gt;Re opening to track the clarifications for when DB will be deprecated.&lt;/p&gt;</comment>
                            <comment id="937737" author="chengas123" created="Thu, 11 Jun 2015 15:14:54 +0000"  >&lt;p&gt;The reason I filed this is that I don&apos;t get a single deprecation warning anywhere in my entire codebase, which is not what you want users to experience when DB goes away one day. However, understanding the situation better now, I see now that&apos;s rather unique to me as an author of a client library. I still think we can do better with documenting this though to make it clearer. I sent a PR here: &lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/pull/318&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/pull/318&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="937678" author="ross@10gen.com" created="Thu, 11 Jun 2015 14:37:17 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=chengas123&quot; class=&quot;user-hover&quot; rel=&quot;chengas123&quot;&gt;chengas123&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;You&apos;re correct that by deprecating &lt;tt&gt;Mongo.getDB&lt;/tt&gt; we have effectively deprecated &lt;tt&gt;DB&lt;/tt&gt; and &lt;tt&gt;DBCollection&lt;/tt&gt;.  Rather, than marking all areas under that code path as deprecated and causing users pain with the 3.x series of the Java Driver we opted to just deprecate the start point.  As such &lt;tt&gt;DB&lt;/tt&gt; and &lt;tt&gt;DBCollection&lt;/tt&gt; can now be seen as the legacy API, it will still be accessible for the duration of 3.x series but will eventually be removed.&lt;/p&gt;

&lt;p&gt;In the 3.0 driver we introduced &lt;tt&gt;MongoDatabase&lt;/tt&gt; and &lt;tt&gt;MongoCollection&lt;/tt&gt; and these along with the new &lt;tt&gt;Document&lt;/tt&gt; class are favoured over the legacy 2.x classes.  This way users can migrate legacy applications to the new API rather than be forced to pick either a 2.x or 3.x driver, this is crucial because the 3.x branch will support the new and upcoming MongoDB features!&lt;/p&gt;

&lt;p&gt;Hope that answers your questions, for future reference these style questions are better suited for the &lt;a href=&quot;https://groups.google.com/group/mongodb-user&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mailing list&lt;/a&gt; as the JAVA project is specifically for driver based bugs or issues.  &lt;/p&gt;

&lt;p&gt;As this was a clear design goal for the 3.0 driver I&apos;m closing this ticket as &quot;Works as Designed&quot;.&lt;/p&gt;

&lt;p&gt;Ross&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|hreaun:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="588">Java Sprint 24</customfieldvalue>
    <customfieldvalue id="712">Java Sprint 25</customfieldvalue>

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