<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:53:35 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-267] Wildcard support in index/query/projection</title>
                <link>https://jira.mongodb.org/browse/SERVER-267</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;db.foo.ensureIndex( &lt;/p&gt;
{ &quot;a.*.b&quot; : 1 }
&lt;p&gt; )&lt;br/&gt;
db.foo.find( &lt;/p&gt;
{ &quot;a.*.b&quot; : 5 }
&lt;p&gt; )&lt;br/&gt;
db.foo.find( {} , &lt;/p&gt;
{ &quot;a.*b&quot; : 1 }
&lt;p&gt; )&lt;/p&gt;</description>
                <environment></environment>
        <key id="10498">SERVER-267</key>
            <summary>Wildcard support in index/query/projection</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="backlog-query-optimization">Backlog - Query Optimization</assignee>
                                    <reporter username="minaguib">Mina Naguib</reporter>
                        <labels>
                    </labels>
                <created>Thu, 27 Aug 2009 00:01:01 +0000</created>
                <updated>Tue, 6 Dec 2022 05:51:23 +0000</updated>
                                            <version>0.9.9</version>
                                                    <component>Index Maintenance</component>
                    <component>Querying</component>
                                        <votes>67</votes>
                                    <watches>65</watches>
                                                                                                                <comments>
                            <comment id="1648299" author="asya" created="Tue, 15 Aug 2017 06:58:24 +0000"  >&lt;p&gt;Our index format/representation relies on field names being the same - that is, we don&apos;t store the names of the fields in the index, just the values.   That may be problematic for fields containing wildcards. &lt;/p&gt;</comment>
                            <comment id="1646662" author="fresheneesz" created="Fri, 11 Aug 2017 20:07:12 +0000"  >&lt;p&gt;@Asya Why wouldn&apos;t it be possible? Should be just as easy to implement as any other index, right? &lt;/p&gt;</comment>
                            <comment id="1646619" author="asya" created="Fri, 11 Aug 2017 19:28:09 +0000"  >&lt;p&gt;As of 3.4.4 there are aggregation expressions that will allow querying by groups of fields (though granted somewhat awkwardly).   I&apos;m not sure if it&apos;s possible to support wildcards for indexing though.&lt;/p&gt;</comment>
                            <comment id="1631747" author="fresheneesz" created="Tue, 25 Jul 2017 22:31:34 +0000"  >&lt;p&gt;Mongo shouldn&apos;t be treating maps as second-class citizens. Anything that can be done with an array should be doable with an object. &lt;/p&gt;</comment>
                            <comment id="1553371" author="lucasbrynte" created="Thu, 20 Apr 2017 07:39:16 +0000"  >&lt;p&gt;I truly agree!&lt;/p&gt;</comment>
                            <comment id="1486502" author="micheal" created="Fri, 27 Jan 2017 03:37:18 +0000"  >&lt;p&gt;Would open up the door for some great schema designs. Please add to roadmap.&lt;/p&gt;</comment>
                            <comment id="494551" author="glenn" created="Thu, 6 Feb 2014 15:30:24 +0000"  >&lt;p&gt;I&apos;ve needed to do this before, due to MongoDB&apos;s limitations with handling arrays.  I think that rather than supporting these queries, it&apos;d be better to fix the limitations of arrays.  After all, even if Mongo supports wildcard key queries, there would still be other things you couldn&apos;t do with dictionary values, like aggregation.  Instead of enhancing dictionaries to let them do things we can already do with arrays (creating a lot of duplication of functionality in the process), enhance arrays so we don&apos;t need to use dictionaries like this in the first place.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6566&quot; title=&quot;Support conditional updates: $updates&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6566&quot;&gt;&lt;del&gt;SERVER-6566&lt;/del&gt;&lt;/a&gt; would fix all of the cases I&apos;ve seen.&lt;/p&gt;</comment>
                            <comment id="361944" author="ndelregno" created="Mon, 17 Jun 2013 17:46:39 +0000"  >&lt;p&gt;I would also like to have this feature.&lt;/p&gt;

&lt;p&gt;I developed a schema for my current project, but then had to rework based on the inability to query using wildcard subkeys.  For example:&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
&quot;_id&quot; : &quot;NY50_A&quot;,&lt;br/&gt;
&quot;ports&quot; : {&lt;br/&gt;
&quot;1/1/1&quot; : &lt;/p&gt;
{ &quot;description&quot; : &quot;TRK to NYBR_B&quot;, &quot;state&quot; : &quot;no shutdown&quot;}
&lt;p&gt;,&lt;br/&gt;
&quot;1/1/2&quot; : &lt;/p&gt;
{ &quot;description&quot; : &quot;PND to NY50_B&quot;, &quot;state&quot; : &quot;shutdown&quot;}
&lt;p&gt;,&lt;br/&gt;
etc...&lt;br/&gt;
          }&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;I&apos;d like to be able to query using db.collection.find(&lt;/p&gt;
{&quot;ports.$.state&quot; : &quot;no shutdown&quot;}
&lt;p&gt;, {_id:1, ports:1}).  This would return all of the ports, in all switches, which are shutdown.&lt;/p&gt;

&lt;p&gt;In lieu of this functionality, I am reevaluating my schema to determine how I can achieve the same effect without having to issue discrete finds for &lt;/p&gt;
{&quot;ports.1/1/1.state&quot; : &quot;no shutdown&quot;}
&lt;p&gt;  and &lt;/p&gt;
{&quot;ports.1/1/2.state&quot; : &quot;no shutdown&quot;}
&lt;p&gt;, etc, since each switch will have different card/port configurations.&lt;/p&gt;

</comment>
                            <comment id="294301" author="ialvarez" created="Wed, 20 Mar 2013 21:08:14 +0000"  >&lt;p&gt;Would also like to have this feature. Or even better, something like $elemMatch query operator that works on keys instead of values.&lt;/p&gt;</comment>
                            <comment id="22529" author="fingermark" created="Thu, 20 Jan 2011 14:57:32 +0000"  >&lt;p&gt;As a beginner MongoDB user, I had no idea that there was no support for this.  Consequently, I modeled my data as follows:&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
        &quot;_id&quot; : &quot;store1&quot;,&lt;br/&gt;
        &quot;name&quot;: &quot;Store 1&quot;,&lt;br/&gt;
        &quot;notes&quot; : {&lt;br/&gt;
                &quot;4d221860edc6ae20218cc50a&quot; : &lt;/p&gt;
{
                        &quot;text&quot; : &quot;aaa&quot;,
                        &quot;hide&quot; : false
                }
&lt;p&gt;,&lt;br/&gt;
                &quot;4d221860edc6ae20218cc50b&quot; : &lt;/p&gt;
{
                        &quot;text&quot; : &quot;bbb&quot;,
                        &quot;hide&quot; : true
                }
&lt;p&gt;,&lt;br/&gt;
                &quot;4d221860edc6ae20218cc50c&quot; : &lt;/p&gt;
{
                        &quot;text&quot; : &quot;ccc&quot;,
                        &quot;hide&quot; : true
                }
&lt;p&gt;        }&lt;br/&gt;
} &lt;/p&gt;

&lt;p&gt;The reason for this is because I have an admin screen to edit notes and the URL is something like /editNotes?id=4d221860edc6ae20218cc50c&lt;/p&gt;

&lt;p&gt;db.stores.find({&apos;notes.4d221860edc6ae20218cc50c&apos;: {$exists: true}})&lt;/p&gt;

&lt;p&gt;This allows me to get the store document containing that note.  And since I treat notes as Map&amp;lt;ObjectId, Notes&amp;gt; notes, I can then just do notes.get(&quot;4d221860edc6ae20218cc50c&quot;); to get the notes for 4d221860edc6ae20218cc50c.  The problem is it&apos;s really hard to maintain this.  For example, let&apos;s say I want to set all notes to hide = false.  How would I do this?  I also had a related question in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-2238&quot; title=&quot;New projection operator $elemMatch&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-2238&quot;&gt;&lt;del&gt;SERVER-2238&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="11412" author="mharris717" created="Fri, 18 Dec 2009 01:10:16 +0000"  >&lt;p&gt;This is not complete at all, still many things to work on, but I have the beginnings of a patch here&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/mharris717/mongo/commit/b27d8577a7c0bec037e5b0939f20bbf0e1b14337&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mharris717/mongo/commit/b27d8577a7c0bec037e5b0939f20bbf0e1b14337&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Passes the basic test cases&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="347668">SERVER-27774</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="476667">SERVER-32472</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="12174">SERVER-1248</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="16272">SERVER-2989</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="11483">SERVER-736</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="575745">SERVER-36261</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="14989">SERVER-2675</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1381855">SERVER-48897</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="16272">SERVER-2989</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>11.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25126"><![CDATA[Query Optimization]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[5002K00000zBVLsQAO]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 18 Dec 2009 01:10:16 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        6 years, 26 weeks, 1 day 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>alexander.golin@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            6 years, 26 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>asya.kamsky@mongodb.com</customfieldvalue>
            <customfieldvalue>backlog-query-optimization</customfieldvalue>
            <customfieldvalue>fresheneesz</customfieldvalue>
            <customfieldvalue>fingermark</customfieldvalue>
            <customfieldvalue>glenn</customfieldvalue>
            <customfieldvalue>ialvarez</customfieldvalue>
            <customfieldvalue>lucasbrynte</customfieldvalue>
            <customfieldvalue>Micheal</customfieldvalue>
            <customfieldvalue>mharris717</customfieldvalue>
            <customfieldvalue>minaguib</customfieldvalue>
            <customfieldvalue>ndelregno</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpw9j:</customfieldvalue>

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

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

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