<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:08:58 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-5463] Indexing for document keys</title>
                <link>https://jira.mongodb.org/browse/SERVER-5463</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;(copied from &lt;a href=&quot;http://groups.google.com/group/mongodb-user/browse_thread/thread/8d6f4fe174895fda&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://groups.google.com/group/mongodb-user/browse_thread/thread/8d6f4fe174895fda&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Given a collection like this:&lt;/p&gt;

&lt;p&gt;db.player = {&lt;br/&gt;
    name: &quot;Glenn&quot;,&lt;br/&gt;
    scores: {&lt;br/&gt;
        ping_pong: &lt;/p&gt;
{ points: 2000 }
&lt;p&gt;,&lt;br/&gt;
        golf: &lt;/p&gt;
{ points: 100 }
&lt;p&gt;    }&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;I want an index on each of the keys of scores, so I can efficiently eg. find and sort on &apos;scores.ping_pong.points&apos;.  However, there are too many keys to create indexes on &apos;scores.ping_pong&apos;, &apos;scores.golf&apos;, and so on--there many be hundreds of possible keys.&lt;/p&gt;

&lt;p&gt;It would help if it was possible to create an index on &apos;scores.$key.points&apos;, which would effectively be a compound index on (key name, points), so this type of structure can be indexed without creating an index for every possible key.  That way, a single index would work for both find(&lt;/p&gt;
{scores.ping_pong.points: 100}
&lt;p&gt;) and find(&lt;/p&gt;
{scores.golf.points: 100}
&lt;p&gt;).  In the above data, two index entries would be created: one on (&apos;ping_pong&apos;, 2000) and the other on (&apos;golf&apos;, 100).&lt;/p&gt;

&lt;p&gt;This could probably also be used to accelerate $exists.  A (&lt;/p&gt;
{&apos;name&apos;: 1, &apos;scores.$key&apos;: 1}
&lt;p&gt;) index should allow find({name: &apos;Glenn&apos;, &apos;scores.ping_pong&apos;: {$exists: true}}) to be done efficiently.&lt;/p&gt;

&lt;p&gt;A compound key of (&apos;x&apos;, &apos;scores.$key.points&apos;, &apos;y&apos;) would expand to (&apos;x&apos;, &apos;key name&apos;, &apos;points&apos;, &apos;y&apos;).  Similarly, (&apos;a.$key.b&apos;, &apos;b.$key.c&apos;) expands to (&apos;first key name&apos;, &apos;b&apos;, &apos;second key name&apos;, &apos;c&apos;).&lt;/p&gt;</description>
                <environment></environment>
        <key id="35111">SERVER-5463</key>
            <summary>Indexing for document keys</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</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="3">Duplicate</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="glenn">Glenn Maynard</reporter>
                        <labels>
                            <label>indexing</label>
                    </labels>
                <created>Fri, 30 Mar 2012 16:40:45 +0000</created>
                <updated>Wed, 15 Aug 2012 14:04:17 +0000</updated>
                            <resolved>Mon, 2 Apr 2012 05:58:05 +0000</resolved>
                                                                    <component>Index Maintenance</component>
                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="107845" author="glenn" created="Mon, 9 Apr 2012 15:21:36 +0000"  >&lt;p&gt;Ping - please reopen.&lt;/p&gt;</comment>
                            <comment id="106084" author="glenn" created="Tue, 3 Apr 2012 16:11:21 +0000"  >&lt;p&gt;I don&apos;t think this is the same as &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1248&quot; title=&quot;Should have an $* array-key-wildcard operator&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1248&quot;&gt;&lt;del&gt;SERVER-1248&lt;/del&gt;&lt;/a&gt;.  This feature would require document keys to be included in the index sort (eg. woCompare(considerFieldName=true)), to allow an &apos;a.$.c&apos; index to be applied to find({}).sort(&lt;/p&gt;
{&apos;a.b.c&apos;:1}
&lt;p&gt;), so the index scales to an unlimited number of distinct keys, and so count() can be performed without an index scan.&lt;/p&gt;

&lt;p&gt;The feature requested in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1248&quot; title=&quot;Should have an $* array-key-wildcard operator&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1248&quot;&gt;&lt;del&gt;SERVER-1248&lt;/del&gt;&lt;/a&gt;, key wildcards in queries, would need document keys to be excluded.&lt;/p&gt;</comment>
                            <comment id="105689" author="eliot" created="Mon, 2 Apr 2012 14:52:25 +0000"  >&lt;p&gt;Will try and make &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1248&quot; title=&quot;Should have an $* array-key-wildcard operator&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1248&quot;&gt;&lt;del&gt;SERVER-1248&lt;/del&gt;&lt;/a&gt; a bit better so its clear its query + index.&lt;/p&gt;</comment>
                            <comment id="105654" author="glenn" created="Mon, 2 Apr 2012 13:44:45 +0000"  >&lt;p&gt;That&apos;s an ugly, hackish workaround.  (I mentioned this in the list post, but omitted it here for brevity since it seems obvious.  If arrays were a reasonable replacement for subdocuments, then we wouldn&apos;t need subdocuments.)&lt;/p&gt;

&lt;p&gt;That said, this isn&apos;t really a duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1248&quot; title=&quot;Should have an $* array-key-wildcard operator&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1248&quot;&gt;&lt;del&gt;SERVER-1248&lt;/del&gt;&lt;/a&gt;.  That one&apos;s asking for a query syntax; I&apos;m requesting an index feature.  The two would complement each other, of course.&lt;/p&gt;</comment>
                            <comment id="105566" author="eliot" created="Mon, 2 Apr 2012 05:58:05 +0000"  >&lt;p&gt;Special case of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1248&quot; title=&quot;Should have an $* array-key-wildcard operator&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1248&quot;&gt;&lt;del&gt;SERVER-1248&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For your specific case, people tend to do:&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;{&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;  name : &quot;Glenn&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;  scores : [&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;    { name : &quot;ping_pong&quot; , points : 2000 } ,&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;    { name : &quot;golf&quot; , points : 100 }&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;  ]&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;}&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&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>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 2 Apr 2012 05:58:05 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        11 years, 45 weeks, 2 days 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>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ian@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            11 years, 45 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>glenn</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hro7mf:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7913</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|ht0a3r:</customfieldvalue>

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