<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:57:12 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-2436] Consider allowing zero-document inserts</title>
                <link>https://jira.mongodb.org/browse/JAVA-2436</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;This is a follow-up of &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-2434&quot; title=&quot;Empty insert causes subsequent queries to hang&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-2434&quot;&gt;&lt;del&gt;JAVA-2434&lt;/del&gt;&lt;/a&gt;. Currently, providing a zero-length list or array to either &lt;tt&gt;DBCollection#insert&lt;/tt&gt; or &lt;tt&gt;MongoCollection#insertMany&lt;/tt&gt; yields an &lt;tt&gt;IllegalArgumentException&lt;/tt&gt;. The question is whether the API can be relaxed to allow such empty inserts.&lt;/p&gt;

&lt;p&gt;Rationale: the collection of documents inserted is generally dynamic, and may in fact be empty in some contexts. As it stands, callers must thus make sure to check for emptiness. It&apos;d be nice if this &quot;burden&quot; can be pushed into the API, as it&apos;s easy to forget to add this check.&lt;/p&gt;

&lt;p&gt;If implementing this feature request turns out to be infeasible, then I&apos;d like to ask that the documentation on these methods be updated to clearly indicate that the input must be nonempty.&lt;/p&gt;</description>
                <environment></environment>
        <key id="349769">JAVA-2436</key>
            <summary>Consider allowing zero-document inserts</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="Stephan202">Stephan Schroevers</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 Jan 2017 16:44:59 +0000</created>
                <updated>Wed, 19 Apr 2017 13:05:10 +0000</updated>
                            <resolved>Wed, 19 Apr 2017 12:58:18 +0000</resolved>
                                                                    <component>API</component>
                    <component>Query Operations</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1552441" author="jeff.yemin" created="Wed, 19 Apr 2017 12:58:10 +0000"  >&lt;p&gt;Hi Stephen,&lt;/p&gt;

&lt;p&gt;I don&apos;t see it as an unreasonable burden to requires applications to make this check themselves.  Applications are in the best position to know whether an empty list of documents is a normal condition.  The driver should not be hiding bugs in applications where this was done inadvertently.  &lt;/p&gt;

&lt;p&gt;Also, as it stands every CRUD method in MongoCollection results in either a message sent to a MongoDB server or an exception.  That&apos;s consistent and easy to understand, and I&apos;d rather not change it.&lt;/p&gt;

&lt;p&gt;I opened &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-2499&quot; title=&quot;Document that MongoCollection#insertMany throws exception if document list is null or empty &quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-2499&quot;&gt;&lt;del&gt;JAVA-2499&lt;/del&gt;&lt;/a&gt; to track your request for clarification of the Javadoc for MongoCollection.  &lt;/p&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10320">
                    <name>Documented</name>
                                                                <inwardlinks description="is documented by">
                                        <issuelink>
            <issuekey id="375417">JAVA-2499</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="349561">JAVA-2434</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <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|hsucf3:</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>