<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:53:34 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-993] Providing a method to return version of the currently connected mongo instance</title>
                <link>https://jira.mongodb.org/browse/JAVA-993</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;Currently from java driver version of the connected Mongo instance can be learn via following code snippet.&lt;/p&gt;

&lt;p&gt;DB db = new MongoClient(&quot;127.0.0.1&quot;).getDB(&quot;test&quot;);&lt;br/&gt;
CommandResult commandResult = db.command(&quot;buildInfo&quot;);&lt;br/&gt;
String serverVersion = commandResult.getString(&quot;version&quot;));&lt;/p&gt;

&lt;p&gt;However similar to CLI DB class can have a method like db.getVersion() to get version of the mongo instance.&lt;/p&gt;</description>
                <environment></environment>
        <key id="93524">JAVA-993</key>
            <summary>Providing a method to return version of the currently connected mongo instance</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="-1">Unassigned</assignee>
                                    <reporter username="fgakk">Fatih G&#252;&#231;l&#252; Akkaya</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Oct 2013 18:46:27 +0000</created>
                <updated>Sun, 27 Nov 2016 03:38:36 +0000</updated>
                            <resolved>Sun, 27 Nov 2016 03:38:36 +0000</resolved>
                                    <version>2.11.3</version>
                                                    <component>API</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1442723" author="jeff.yemin" created="Sun, 27 Nov 2016 03:38:36 +0000"  >&lt;p&gt;See the Cluster Monitoring section of &lt;a href=&quot;http://mongodb.github.io/mongo-java-driver/3.3/driver/reference/management/monitoring/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://mongodb.github.io/mongo-java-driver/3.3/driver/reference/management/monitoring/&lt;/a&gt; for an alternative solution.&lt;/p&gt;</comment>
                            <comment id="438792" author="jeff.yemin" created="Thu, 10 Oct 2013 13:06:14 +0000"  >&lt;p&gt;Thanks for sharing the use case.&lt;/p&gt;</comment>
                            <comment id="438769" author="fgakk" created="Thu, 10 Oct 2013 11:25:53 +0000"  >&lt;p&gt;I come across an issue that in need to add an array of items under an array field. For mongo instance lower than 2.4 in need to use $pushAll. (Current mongo version is 2.2.2) However i do not my code to be affect by mongo version change, so for safety i need to get the version in order to do following&lt;/p&gt;

&lt;p&gt;if (version &amp;lt; 2.4)&lt;br/&gt;
   //do with $pushAll&lt;br/&gt;
else&lt;br/&gt;
  //do with $push with $each&lt;/p&gt;

&lt;p&gt;Currently i do not know another use case, where i needed this kind of switch, but it would be also nice to use it for logging.&lt;/p&gt;</comment>
                            <comment id="438505" author="jeff.yemin" created="Wed, 9 Oct 2013 21:13:51 +0000"  >&lt;p&gt;I&apos;m curious what you want to do different in your code based on the version of Mongo?  Or do you just want to log it?&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|hrtfm7:</customfieldvalue>

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