<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:33:33 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>[SERVER-14002] issue querying data </title>
                <link>https://jira.mongodb.org/browse/SERVER-14002</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;I just came across an interesting issue in 2.4.9. Not sure if this is a know issue or not but I thought I&apos;ll send it across.&lt;br/&gt;
If you create a document with a char attribute that&apos;s longer than 1011 characters a search via a regular express will not find it yet if you give it a hint to use the &lt;em&gt;id&lt;/em&gt; index the document will be found. BTW, the problem is fixed in 2.6.1, ie not a problem for us anymore since we are already upgrading to 2.6.1.&lt;/p&gt;

&lt;p&gt;Insert the 2 test records below into collection test on a 2.4.9 instance and the first query returns 1 document, the second query returns 2 documents. In 2.6.1 both queries return 2 documents. Only difference between the documents is that attribute c has 1 additional character.&lt;/p&gt;

&lt;p&gt;Thanks&lt;br/&gt;
Robert&lt;/p&gt;

&lt;p&gt;db.test.find(&lt;/p&gt;
{&quot;c&quot; : /123456789/}
&lt;p&gt;)&lt;br/&gt;
db.test.find(&lt;/p&gt;
{&quot;c&quot; : /123456789/}
&lt;p&gt;).hint(&quot;&lt;em&gt;id&lt;/em&gt;&quot;)&lt;/p&gt;


&lt;p&gt;{&lt;br/&gt;
    &quot;_id&quot; : &quot;1&quot;,&lt;br/&gt;
    &quot;c&quot; : &quot;012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890&quot;&lt;br/&gt;
}&lt;br/&gt;
{&lt;br/&gt;
    &quot;_id&quot; : &quot;2&quot;,&lt;br/&gt;
    &quot;c&quot; : &quot;0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901&quot;&lt;br/&gt;
}&lt;/p&gt;</description>
                <environment></environment>
        <key id="137351">SERVER-14002</key>
            <summary>issue querying data </summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="thomas.rueckstiess@mongodb.com">Thomas Rueckstiess</assignee>
                                    <reporter username="rfehrmann@snagajob.com">Robert Fehrmann</reporter>
                        <labels>
                    </labels>
                <created>Tue, 20 May 2014 18:26:59 +0000</created>
                <updated>Wed, 10 Dec 2014 23:11:51 +0000</updated>
                            <resolved>Wed, 21 May 2014 15:27:35 +0000</resolved>
                                                                    <component>Querying</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="591718" author="thomasr" created="Wed, 21 May 2014 15:27:35 +0000"  >&lt;p&gt;You are welcome, Robert. I&apos;m glad I could clarify that issue. &lt;/p&gt;

&lt;p&gt;I&apos;m resolving the ticket now.&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
Thomas&lt;/p&gt;</comment>
                            <comment id="591025" author="rfehrmann@snagajob.com" created="Wed, 21 May 2014 00:39:53 +0000"  >&lt;p&gt;Thomas,&lt;/p&gt;

&lt;p&gt;In fact I hadn&apos;t even notices the second index on &quot;c&quot; and you are right, this problem only hits in case there&apos;s an index on attribute c and you can&apos;t create an index on a column that&apos;s too long in 2.6.1.&lt;/p&gt;

&lt;p&gt;So I got exactly the same results as you. Thank you so much for looking into this case.&lt;/p&gt;

&lt;p&gt;Thanks&lt;br/&gt;
Robert&lt;/p&gt;
</comment>
                            <comment id="590893" author="thomasr" created="Tue, 20 May 2014 22:41:07 +0000"  >&lt;p&gt;Hi Robert,&lt;/p&gt;

&lt;p&gt;I believe this issue has to do with the maximum size of an index key entry, which is 1024 in MongoDB (including structural BSON overhead), see &lt;a href=&quot;http://docs.mongodb.org/manual/reference/limits/#Index-Key-Limit&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;MongoDB Limits&lt;/a&gt;. But I&apos;d like to ask some questions to clarify:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Did you have an index on {&lt;tt&gt;c:1&lt;/tt&gt;} in the example with 2.4.9 ? I can only reproduce the behavior you describe if this index is present.&lt;/li&gt;
	&lt;li&gt;For 2.6.1 I&apos;m assuming you did not have an index on  {&lt;tt&gt;c:1&lt;/tt&gt;} because we&apos;ve changed the behavior of having too large entries. They are now rejected (rather than silently ignored) and therefore it&apos;s not possible to have that document indexed. Can you confirm?&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;So my hypothesis is this: You had an index on {&lt;tt&gt;c:1&lt;/tt&gt;} in 2.4.9, but the too large document was not present in the index (the log file would have contained lines like this when building the index: &lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;Tue May 20 18:22:58.567 [conn3] build index test.test { c: 1.0 }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;Tue May 20 18:22:58.568 [conn3]  test.system.indexes Btree::insert: key too large to index, skipping test.test.$c_1 1025 { : &quot;012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789...&quot; }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;Tue May 20 18:22:58.568 [conn3] warning: not all entries were added to the index, probably some keys were too large&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;Tue May 20 18:22:58.568 [conn3] build index done.  scanned 2 total records. 0.001 secs&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;Now if you query with the regex (or any other query that uses the index on c), it will only return the indexed document. A query with hint() on _id will return both documents, as both are in the _id index.&lt;/p&gt;

&lt;p&gt;I was not able to reproduce what you are seeing with 2.6.1 because like I said it&apos;s not possible to have an index on {&lt;tt&gt;c:1&lt;/tt&gt;} with such a document. If you repeated the test in 2.6.1 without an index on {&lt;tt&gt;c:1&lt;/tt&gt;} then you would always get both documents back.  &lt;/p&gt;

&lt;p&gt;Can you repeat your queries on 2.6.1 but add an &lt;tt&gt;.explain()&lt;/tt&gt; to the end of the queries and paste the output below?&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Thomas&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 20 May 2014 22:41:07 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        9 years, 39 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></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_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>false</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            9 years, 39 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>rfehrmann@snagajob.com</customfieldvalue>
            <customfieldvalue>thomas.rueckstiess@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrluo7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hryysv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>118259</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hsgwhb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>