<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 09:01:28 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-4198] BasicDBObject.toString() returns STRICT extended JSON, expecting RELAXED</title>
                <link>https://jira.mongodb.org/browse/JAVA-4198</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;Older versions (pre-3.7) of the driver when calling&#160;BasicDBObject.toString() returns simple JSON output, i.e &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;{&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;   &quot;name&quot; :&#160; &quot;foo&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;   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;   &quot;age&quot; : 10}&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;New versions (3.7 to 3.12), when calling the BasicDBObject.toString() method returns STRICT extended json: i.e &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;{&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;   &quot;name&quot; :  &quot;foo&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;   &quot;age&quot; : {&quot;$numberLong&quot;: 10&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;   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;Would it is possible to override the default behavior by some flag instead of using the &lt;tt&gt;BasicDBObject.toJson(JsonWriterSettings)&lt;/tt&gt;. Some applications rely on the prior behavior to feed other libraries that doesn&apos;t expect extended json.&lt;br/&gt;
&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="1786037">JAVA-4198</key>
            <summary>BasicDBObject.toString() returns STRICT extended JSON, expecting RELAXED</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="10300" iconUrl="https://jira.mongodb.org/images/icons/priorities/medium.svg">Unknown</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="13202">Works as Designed</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="adamo.tonete@mongodb.com">Adamo Tonete</reporter>
                        <labels>
                            <label>internal-user</label>
                    </labels>
                <created>Wed, 16 Jun 2021 13:35:54 +0000</created>
                <updated>Fri, 27 Oct 2023 13:20:56 +0000</updated>
                            <resolved>Fri, 9 Jul 2021 12:05:18 +0000</resolved>
                                    <version>3.7.0</version>
                    <version>3.12.0</version>
                                                    <component>BSON</component>
                    <component>JSON</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="3881843" author="jeff.yemin" created="Wed, 16 Jun 2021 17:23:49 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=adamo.tonete&quot; class=&quot;user-hover&quot; rel=&quot;adamo.tonete&quot;&gt;adamo.tonete&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can&apos;t really add any new behavior in the 3.12 driver, since at this point we&apos;re only doing patch releases according to the definitions in &lt;a href=&quot;https://semver.org/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://semver.org/&lt;/a&gt;.  &lt;/p&gt;

&lt;p&gt;Note though that in the 4.0 release of the driver, &lt;tt&gt;BasicDBObject.toString()&lt;/tt&gt; does return RELAXED extended JSON.&lt;/p&gt;</comment>
                            <comment id="3881806" author="jeff.yemin" created="Wed, 16 Jun 2021 17:12:02 +0000"  >&lt;p&gt;A few notes:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;In scope of &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-2521&quot; title=&quot;Repackage the driver so that packages are no longer divided&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-2521&quot;&gt;&lt;del&gt;JAVA-2521&lt;/del&gt;&lt;/a&gt;, the JSON output of &lt;tt&gt;toString&lt;/tt&gt; changed from using the deprecated &lt;tt&gt;com.mongodb.util.JSON&lt;/tt&gt; class to &lt;tt&gt;org.bson.JsonWriter&lt;/tt&gt;, using STRICT mode. That change was included in the 3.7 release of the driver.&lt;/li&gt;
	&lt;li&gt;In scope of &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-2556&quot; title=&quot;Change toJson method contract to default to extJSON relaxed mode&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-2556&quot;&gt;&lt;del&gt;JAVA-2556&lt;/del&gt;&lt;/a&gt;, the JSON output mode was changed from STRICT to RELAXED. That change was included in the 4.0 release of the driver. It affects both the &lt;tt&gt;toString&lt;/tt&gt; and &lt;tt&gt;toJson&lt;/tt&gt; methods of &lt;tt&gt;BasicDBObject&lt;/tt&gt;&lt;/li&gt;
	&lt;li&gt;The differences between STRICT and RELAXED are specified &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/extended-json.rst#conversion-table&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;.&lt;/li&gt;
	&lt;li&gt;Even in RELAXED mode, there are still subtle differences between the output created by &lt;tt&gt;com.mongodb.util.JSON&lt;/tt&gt; and RELAXED extended JSON. The output of the former was never fully specified. As an example, binary data was output as the string &lt;tt&gt;&quot;&amp;lt;Binary Data&amp;gt;&quot;&quot;&lt;/tt&gt;.&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="404230">JAVA-2556</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                    <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[5002K00000vexioQAA]]]></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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hz77gv:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>