<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:53:33 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-992] Insert easily into MongoDB - convert to DBObject </title>
                <link>https://jira.mongodb.org/browse/JAVA-992</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;It has come up many times to be able to take an XML message and insert into MongoDB as a proper BSON document (not an XML string).  &lt;/p&gt;

&lt;p&gt;Many people pose it as converting XML to JSON but of course one inserts into MongoDB through the MongoDB drivers so one doesn&apos;t actually convert to JSON and there are not standard public libraries for MongoDB like JSON.  &lt;/p&gt;

&lt;p&gt;It would be useful to have a method to convert an XML document (or have a constructor) to a DBObject, mapping attributes,  elements, and multiple elements appropriately or with options to decide from a few reasonable ways of mapping. &lt;/p&gt;

&lt;p&gt;I have heard this mostly from enterprises who mostly use Java so adding to this project but could be true of all the MongoDB drivers.  &lt;/p&gt;</description>
                <environment></environment>
        <key id="92988">JAVA-992</key>
            <summary>Insert easily into MongoDB - convert to DBObject </summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="matt.kalan@mongodb.com">Matt Kalan</reporter>
                        <labels>
                    </labels>
                <created>Mon, 7 Oct 2013 14:28:09 +0000</created>
                <updated>Wed, 4 Dec 2013 18:26:25 +0000</updated>
                            <resolved>Wed, 4 Dec 2013 18:26:25 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="437237" author="jeff.yemin" created="Tue, 8 Oct 2013 15:00:05 +0000"  >&lt;p&gt;Though I did find &lt;a href=&quot;http://www.bramstein.com/projects/xsltjson/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.bramstein.com/projects/xsltjson/&lt;/a&gt;, which tries its best. &lt;/p&gt;</comment>
                            <comment id="436543" author="jeff.yemin" created="Mon, 7 Oct 2013 14:43:22 +0000"  >&lt;p&gt;Matt, there is no canonical mapping between XML and either JSON or BSON, and there are a number of problems with creating one (this list is not exhaustive):&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Without a schema, XML has no notion of data types.  Every value is a string, so there is no way to reliably distinguish strings from int32 from int64 from boolean.&lt;/li&gt;
	&lt;li&gt;XML has no built-in support for lists.  One would have to derive it from repeated element names.&lt;/li&gt;
	&lt;li&gt;XML has both attributes and elements, and they can have the same names.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Anything that we do, the customer would have to supply the mapping rules.  There is nothing generic we can do that will reliably give accurate results.&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|hrtcnb:</customfieldvalue>

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