<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 09:02:01 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-4416] Undocumented behavior change for createIndex from &apos;DB&apos; api to &apos;Document&apos; API?</title>
                <link>https://jira.mongodb.org/browse/JAVA-4416</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;&#160;&lt;br/&gt;
I&apos;m trying to determine if there is undocumented (or at least, the documentation is difficult to find) behavior change re index creation in the MongoDB Java client from the legacy &lt;tt&gt;DB&lt;/tt&gt; based API to the newer &lt;tt&gt;Document&lt;/tt&gt; based API.&lt;/p&gt;

&lt;p&gt;We have an application that started on Mongo 2.4, when if a document had an indexed field with size &amp;gt; 1024B, Mongo would insert the document but not include it in the index.&lt;/p&gt;

&lt;p&gt;When we upgraded to 2.6, which fails when trying to index large fields, we discovered this error the hard way and fixed it in our application. However, the old unindexed documents remained in the collection, and didn&apos;t seem to cause any problems.&lt;/p&gt;

&lt;p&gt;We&apos;ve since upgraded to Mongo 3.6 (but not yet WiredTiger), and up until recently were using the legacy &lt;tt&gt;DB&lt;/tt&gt; API in the Java client version 3.8.2, using &lt;tt&gt;createIndex&lt;/tt&gt; to ensure/create indexes on application startup.&lt;/p&gt;

&lt;p&gt;We finally switched over to the new &lt;tt&gt;Document&lt;/tt&gt; based API &lt;em&gt;without&lt;/em&gt; updating the client version and now the app will not start due to &lt;tt&gt;com.mongodb.MongoWriteException: Btree::insert: key too large to index&lt;/tt&gt; errors.&lt;/p&gt;

&lt;p&gt;My assumption here is that the old API would still ignore existing documents with large index values when creating (well, ensuring really, since the indexes have existed for years) indexes, but the new API fails. Is it possible to confirm this? So far I&apos;ve been unable to do so and I&apos;m worried I&apos;m barking up the wrong tree.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1933414">JAVA-4416</key>
            <summary>Undocumented behavior change for createIndex from &apos;DB&apos; api to &apos;Document&apos; API?</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="10300" iconUrl="https://jira.mongodb.org/images/icons/priorities/medium.svg">Unknown</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="13200">Declined</resolution>
                                        <assignee username="valentin.kovalenko@mongodb.com">Valentin Kavalenka</assignee>
                                    <reporter username="gaprice@lbl.gov">Gavin Price</reporter>
                        <labels>
                            <label>external-user</label>
                    </labels>
                <created>Thu, 25 Nov 2021 04:50:24 +0000</created>
                <updated>Fri, 25 Aug 2023 13:31:19 +0000</updated>
                            <resolved>Tue, 30 Nov 2021 17:19:04 +0000</resolved>
                                    <version>3.8.2</version>
                                                    <component>API</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="4221429" author="JIRAUSER1258163" created="Tue, 30 Nov 2021 17:19:04 +0000"  >&lt;p&gt;Closed as &quot;Declined&quot; with accordance to the latest reporter&apos;s comment.&lt;/p&gt;</comment>
                            <comment id="4216455" author="gaprice@lbl.gov" created="Tue, 30 Nov 2021 04:21:15 +0000"  >&lt;p&gt;Update: I&apos;m an idiot and didn&apos;t read the stack trace carefully enough - as soon as I saw the `key too large to index` error I assumed it was happening on the `createIndex` call. It&apos;s actually happening on an `updateMany` call since the new version of the app is performing an update of all the documents in one of the collections. So the old document that couldn&apos;t be indexed in 2.4 is updated and 3.6 tries to index it and complains.&lt;/p&gt;

&lt;p&gt;Sorry for the noise.&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|hzv09b:</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>