<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:55: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-1692] Suggest adding #size and/or #isEmpty method to BulkWriteOperation</title>
                <link>https://jira.mongodb.org/browse/JAVA-1692</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;BulkWriteOperation does not provide any means of detecting how many operations have been posted to it. Given that attempting to execute an empty BWO throws an exception, this makes it slightly more complicated than it ought to be to implement, say, a class that provides a single-record #insert() method and internally buffers operations for bulk execution. A private #flush() method in such a class (invoked by #insert() and by #close() when the client is finished inserting records) would need to explicitly coordinate with #insert to know whether or not to submit the BWO for execution.&lt;/p&gt;

&lt;p&gt;This could be alleviated by providing #size() and/or #isEmpty() methods on BWO. Either could be used by #flush() to decide whether to execute the BWO. And they&apos;re very natural operations regardless.&lt;/p&gt;

&lt;p&gt;Alternatively, one could take the JDBC approach, and make execution of any empty BWO a no-op, just as Statement#execBatch() on a statement object whose #addBatch() method has not been invoked is a no-op in JDBC. In my opinion, that&apos;s a more sensible design than throwing an exception, but it would potentially break existing appplications.&lt;/p&gt;</description>
                <environment>Windows 7 64-bit, Java 1.7, MongoDB v3.0</environment>
        <key id="189871">JAVA-1692</key>
            <summary>Suggest adding #size and/or #isEmpty method to BulkWriteOperation</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="andylowry">Andy Lowry</reporter>
                        <labels>
                            <label>bulk_api</label>
                    </labels>
                <created>Mon, 16 Mar 2015 19:50:27 +0000</created>
                <updated>Wed, 8 Nov 2017 15:00:00 +0000</updated>
                            <resolved>Wed, 8 Nov 2017 15:00:00 +0000</resolved>
                                    <version>2.13.0</version>
                                                    <component>API</component>
                                        <votes>1</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="1720364" author="jeff.yemin" created="Wed, 8 Nov 2017 15:00:00 +0000"  >&lt;p&gt;Closing this as Won&apos;t Fix, as the new CRUD API does not suffer from this deficiency.&lt;/p&gt;</comment>
                            <comment id="1061999" author="jeff.yemin" created="Thu, 15 Oct 2015 19:01:56 +0000"  >&lt;p&gt;It may not help you, but just so you know the new CRUD API in the 3.x driver series will allow you to do this, since a bulk write is just a method that takes a List of write requests.  See the &lt;a href=&quot;http://mongodb.github.io/mongo-java-driver/3.1/driver/getting-started/quick-tour/#bulk-operations&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Quick Tour&lt;/a&gt; for an example.&lt;/p&gt;</comment>
                            <comment id="1061992" author="simonchan2014" created="Thu, 15 Oct 2015 18:53:57 +0000"  >&lt;p&gt;I was looking for just the thing and I&apos;m glad you have raised a jira for this feature. &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="10038"><![CDATA[Fully Compatible]]></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|hs7693:</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>