<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:52:15 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-429] Allow DBCollections to be modified using  raw/binary BSON.</title>
                <link>https://jira.mongodb.org/browse/JAVA-429</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;For any case where DBCollection takes a DBObject i would like to be able to pass raw/binary BSON, rather than build a concrete DBObject object such as BasicDBObject.&lt;/p&gt;

&lt;p&gt;For my usecase i need to serialize DBObjects offline before i eventually update/insert them into DBCollection.  &lt;/p&gt;

&lt;p&gt;So rather than serialize offline, then deserialize, then build a DBObject, then call DBCollection, which then serializes the DBObject to BSON for transport over-the-wire to the Mongodb, i would rather serialize offline directly to binary BSON, then pass the BSON directly to DBCollection.&lt;/p&gt;

&lt;p&gt;It appears that RawDBObject is exactly what i need, but there is no public constructor and no usage doc or any tests that i can see?&lt;/p&gt;</description>
                <environment></environment>
        <key id="21831">JAVA-429</key>
            <summary>Allow DBCollections to be modified using  raw/binary BSON.</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="9">Done</resolution>
                                        <assignee username="jeff.yemin@mongodb.com">Jeffrey Yemin</assignee>
                                    <reporter username="marko">Marko</reporter>
                        <labels>
                    </labels>
                <created>Fri, 2 Sep 2011 17:43:44 +0000</created>
                <updated>Wed, 14 May 2014 19:03:07 +0000</updated>
                            <resolved>Tue, 15 May 2012 12:41:23 +0000</resolved>
                                    <version>2.6.5</version>
                                    <fixVersion>2.8.0</fixVersion>
                                    <component>API</component>
                    <component>Performance</component>
                                        <votes>1</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="134043" author="jeff.yemin" created="Mon, 18 Jun 2012 19:36:09 +0000"  >&lt;p&gt;Closing for 2.8.0 release.&lt;/p&gt;</comment>
                            <comment id="119571" author="jeff.yemin" created="Tue, 15 May 2012 12:40:45 +0000"  >&lt;p&gt;You can do this with com.mongodb.LazyDBObject. See com.mongodb.LazyDBObjectTest#testLazyDBEncoder unit test for an example of usage.  This will be in 2.8.0.&lt;/p&gt;</comment>
                            <comment id="52581" author="marko" created="Tue, 6 Sep 2011 15:31:28 +0000"  >&lt;p&gt;Awesome.  Any idea what version these changes might be targeted for?&lt;/p&gt;

&lt;p&gt;Thanks for your consideration Scott.&lt;/p&gt;</comment>
                            <comment id="52577" author="scotthernandez" created="Tue, 6 Sep 2011 15:24:19 +0000"  >&lt;p&gt;Yes, marko, that could be an option. &lt;/p&gt;

&lt;p&gt;The Lazy* code is still under active dev, but what you have described would be part of the goal for encoding it back to a bson stream.&lt;/p&gt;</comment>
                            <comment id="52572" author="marko" created="Tue, 6 Sep 2011 15:19:07 +0000"  >&lt;p&gt;Was looking a little closer at the source.&lt;/p&gt;

&lt;p&gt;If i&apos;m following the code correctly, it seems that OutMessage is ultimately responsible for streaming the requested BSONObject to the DBCollection.  But there does not seem to be anything in the API that currently allows the OutMessage to directly send an internal binary encoding of a BSONObject?  It always seems to stream the BSONObject by recursing through each field.&lt;/p&gt;

&lt;p&gt;Maybe a new serialization interface could be created that BSONObjects could optionally implement that allow the BSONObject to take responsibility for the serialization?  Implements such as LazyBSONObject could then implement the interface, exposing a very efficient way to serialize it&apos;s internal binary encoding (basically just directly writing it&apos;s internal buffer).&lt;/p&gt;

&lt;p&gt;Then maybe for my usecase i could then use BSONEncoder to serialize offline, then i would deserialize using the LazyBSONDecoder, and use that result to efficiently write to the DBCollection.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10011"><![CDATA[Minor Change]]></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|hrhbpz:</customfieldvalue>

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