<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:53:41 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-1050] Establishing an empty array during insert</title>
                <link>https://jira.mongodb.org/browse/JAVA-1050</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;Hi there,&lt;/p&gt;

&lt;p&gt;We&apos;re setting up a document collection that will hold 24 months of data result sets that we&apos;ll use to supply data to our reporting applications.&lt;br/&gt;
We&apos;re currently using an array to hold the result sets, each element in the array contains the rows of data that pertain to a particular month.&lt;/p&gt;

&lt;p&gt;We&apos;re going to build up the documents month-by-month, and are using a TTL index (so we have PowerOf2Sizes for the collection).  I thought I had understood that we can help with space allocation by allocating 24 elements to the array when we first create the document.&lt;/p&gt;

&lt;p&gt;My question is, what&apos;s the most efficient way to do that?  I thought I could use the $setOnInsert property to establish the array, then use a $set in the same update statement to insert the element into the array, but I found that&apos;s not allowed.&lt;br/&gt;
Now it feels like I need to make a separate call to check whether the document exists, add the 24 element array, then have a second statement that adds the first element.  Checking whether a document exists before each update statement sounds like a lot of overhead to me, so I wanted to ask the question about how best to accomplish this.&lt;/p&gt;

&lt;p&gt;Thanks for your help!&lt;/p&gt;

&lt;p&gt;Matt&lt;/p&gt;</description>
                <environment>development</environment>
        <key id="98492">JAVA-1050</key>
            <summary>Establishing an empty array during insert</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="4">Incomplete</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="reichert@cobaltgroup.com">Matt Reichert</reporter>
                        <labels>
                    </labels>
                <created>Thu, 14 Nov 2013 20:08:30 +0000</created>
                <updated>Wed, 11 Sep 2019 19:11:42 +0000</updated>
                            <resolved>Fri, 15 Nov 2013 00:54:50 +0000</resolved>
                                    <version>2.4</version>
                                                    <component>Command Operations</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="456596" author="jeff.yemin" created="Fri, 15 Nov 2013 00:54:30 +0000"  >&lt;p&gt;Hi Matt,&lt;/p&gt;

&lt;p&gt;This particular Jira project it for reporting bugs or requesting features for the MongoDB Java driver.  I suggest you ask your question in a different forum, either StackOverflow 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|hru7t3:</customfieldvalue>

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