<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:53:46 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-1086] Var. is over Max BSON size 16777216</title>
                <link>https://jira.mongodb.org/browse/JAVA-1086</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;Hey,&lt;/p&gt;

&lt;p&gt;I am working with Matlab + the Java driver. I want to write some really big data into my MongoDB on my PC.&lt;/p&gt;

&lt;p&gt;I want to write data via&lt;/p&gt;

&lt;p&gt;doc = BasicDBObject();&lt;br/&gt;
doc.put(&apos;title&apos;, &apos;song_title&apos;);&lt;br/&gt;
doc.put(&apos;song_data&apos;, xyz);&lt;/p&gt;

&lt;p&gt;into the DB. Writing small data into the DB is working fine, but I have a problem with big data.&lt;/p&gt;

&lt;p&gt;The data I want to write into the matrix is a matrix of 11,000,000x1.&lt;br/&gt;
Because of limitations of BSON and MongoDB driver I get always the error:&lt;/p&gt;

&lt;p&gt;Error using mongodb_test (line 152)&lt;br/&gt;
Java exception occurred:&lt;br/&gt;
com.mongodb.MongoInternalException: DBObject of size 199421593 is over Max BSON size 16777216&lt;br/&gt;
	at com.mongodb.OutMessage.putObject(OutMessage.java:291)&lt;br/&gt;
	at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:239)&lt;br/&gt;
	at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:204)&lt;br/&gt;
	at com.mongodb.DBCollection.insert(DBCollection.java:148)&lt;br/&gt;
	at com.mongodb.DBCollection.insert(DBCollection.java:91)&lt;/p&gt;


&lt;p&gt;How can I store such a big file in the DB. The bandwith is not the big problem, because I am working in a local network. What can I change on the MongoDB driver or in bson for a successfull run?&lt;/p&gt;

&lt;p&gt;regards&lt;br/&gt;
Tobi&lt;/p&gt;</description>
                <environment>Manjaro Linux (Arch) - MongoDB 2.4.8-2</environment>
        <key id="106469">JAVA-1086</key>
            <summary>Var. is over Max BSON size 16777216</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="-1">Unassigned</assignee>
                                    <reporter username="matl">Tobias Mas</reporter>
                        <labels>
                            <label>bson</label>
                            <label>driver</label>
                            <label>java</label>
                            <label>mongodb</label>
                    </labels>
                <created>Fri, 17 Jan 2014 01:04:29 +0000</created>
                <updated>Wed, 11 Sep 2019 19:12:02 +0000</updated>
                            <resolved>Fri, 17 Jan 2014 01:45:34 +0000</resolved>
                                                                    <component>BSON</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="483493" author="matl" created="Fri, 17 Jan 2014 02:30:22 +0000"  >&lt;p&gt;and where can I change the server-defined limits?&lt;/p&gt;</comment>
                            <comment id="483492" author="matl" created="Fri, 17 Jan 2014 02:28:13 +0000"  >&lt;p&gt;Thanks for your fast answer, but let me ask your one more question.&lt;/p&gt;

&lt;p&gt;I already read something about GridFS, but it will not work yet. Can your please give a few lines of code, how I could write a few data to a GridFS?&lt;br/&gt;
Writing data via&lt;br/&gt;
doc = BasicDBObject();&lt;br/&gt;
doc.put(&apos;title&apos;, &apos;song_title&apos;);&lt;/p&gt;

&lt;p&gt;works fine, but how can I manage writing into GridFS via Java Client?&lt;/p&gt;

&lt;p&gt;regards&lt;br/&gt;
Tobi&lt;/p&gt;</comment>
                            <comment id="483488" author="jeff.yemin" created="Fri, 17 Jan 2014 01:45:34 +0000"  >&lt;p&gt;Hi Tobias,&lt;/p&gt;

&lt;p&gt;This is more of a general MongoDB design question than a question about the Java driver, as there is nothing the Java driver itself can do to change the server-defined limits.  &lt;/p&gt;

&lt;p&gt;Generally for problems of this sort you have two options:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Figure out a way to logically split your document into multiple documents that are &amp;lt; 16 MB&lt;/li&gt;
	&lt;li&gt;Use &lt;a href=&quot;http://docs.mongodb.org/manual/core/gridfs/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;GridFS&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;If you&apos;d like further assistance on your schema design, please ask a question on either Stack Overflow or the mongodb-user Google group.&lt;/p&gt;


&lt;p&gt;Regards,&lt;br/&gt;
Jeff&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|hrvg1r:</customfieldvalue>

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