<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:56:49 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-1366] $in operator not behaving as expect in compound key scenarios</title>
                <link>https://jira.mongodb.org/browse/SERVER-1366</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;I have a compound key. Searching it directly works just fine.&lt;/p&gt;

&lt;p&gt; find({_id : { a:&apos;1&apos;, b:&apos;2&apos; }}) -&amp;gt; 1 doc&lt;/p&gt;

&lt;p&gt;As I want to get a couple of documents in on query, varying on the second part of the key I tried&lt;/p&gt;

&lt;p&gt; find({_id : { a:&apos;1&apos;, b: { $in: &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;2&amp;#39;&amp;#93;&lt;/span&gt; }}) -&amp;gt; 0 docs&lt;/p&gt;

&lt;p&gt;while this was expected to give the very same result. After lots of tries I found that only&lt;/p&gt;

&lt;p&gt; find({ _id: { $in: [&lt;/p&gt;
{ a: &apos;1&apos;, b: &apos;2&apos; }
&lt;p&gt;] ]}) -&amp;gt; 1 docs&lt;/p&gt;

&lt;p&gt;works. Which essentially means one needs to send a lot of duplicated data in a query.&lt;/p&gt;

&lt;p&gt; find({ _id: { $in: [&lt;/p&gt;
{ a: &apos;1&apos;, b: &apos;1&apos; }
&lt;p&gt;,&lt;/p&gt;
{ a: &apos;1&apos;, b: &apos;2&apos; }
&lt;p&gt;,&lt;/p&gt;
{ a: &apos;1&apos;, b: &apos;3&apos; }
&lt;p&gt;,&lt;/p&gt;
{ a: &apos;1&apos;, b: &apos;4&apos; }
&lt;p&gt;] ]}) -&amp;gt; 4 docs&lt;/p&gt;

&lt;p&gt;Even worse - there is no error message or reason given why the $in operator does not work in compound keys.&lt;/p&gt;

&lt;p&gt;Could be related to &lt;a href=&quot;http://jira.mongodb.org/browse/SERVER-1026&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;http://jira.mongodb.org/browse/SERVER-1026&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="12353">SERVER-1366</key>
            <summary>$in operator not behaving as expect in compound key scenarios</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="9">Done</resolution>
                                        <assignee username="eliot">Eliot Horowitz</assignee>
                                    <reporter username="tcurdt">Torsten Curdt</reporter>
                        <labels>
                    </labels>
                <created>Tue, 6 Jul 2010 12:21:50 +0000</created>
                <updated>Tue, 6 Jul 2010 13:46:50 +0000</updated>
                            <resolved>Tue, 6 Jul 2010 12:54:51 +0000</resolved>
                                    <version>1.4.4</version>
                                                    <component>Querying</component>
                                        <votes>1</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="15452" author="tcurdt" created="Tue, 6 Jul 2010 13:46:50 +0000"  >&lt;p&gt;Well, I would vote for that error.&lt;/p&gt;

&lt;p&gt;Arguing from a users perspective it&apos;s not that clear why it should not be allowed in that context.&lt;br/&gt;
The least one should get is an indication that there was something wrong about this.&lt;/p&gt;</comment>
                            <comment id="15451" author="eliot" created="Tue, 6 Jul 2010 13:30:52 +0000"  >&lt;p&gt;$in is a query operator in the right context.&lt;br/&gt;
so its not an operator there.&lt;/p&gt;

&lt;p&gt;we do say fields can&apos;t start with $, so that makes it unable to be saved, so perhaps there could be an error because of that, but not sure&lt;/p&gt;</comment>
                            <comment id="15450" author="tcurdt" created="Tue, 6 Jul 2010 13:25:09 +0000"  >&lt;p&gt;but $in is a query operator&lt;/p&gt;</comment>
                            <comment id="15446" author="eliot" created="Tue, 6 Jul 2010 13:08:06 +0000"  >&lt;p&gt;Its valid syntax, just wrong.&lt;br/&gt;
That&apos;s looking for the document that has the _id { a:&apos;1&apos;, b: &lt;/p&gt;
{ $in: [&apos;2&apos;] }
&lt;p&gt; }&lt;/p&gt;</comment>
                            <comment id="15445" author="tcurdt" created="Tue, 6 Jul 2010 13:06:18 +0000"  >&lt;p&gt;So if that syntax I gave is not supported ...shouldn&apos;t that give an error?&lt;/p&gt;

&lt;p&gt;I am confused why that needs a separate index though.&lt;/p&gt;

&lt;p&gt;...and I am amazed how quickly this issue got attention &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                            <comment id="15441" author="auto" created="Tue, 6 Jul 2010 12:54:20 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;erh&apos;, &apos;name&apos;: &apos;Eliot Horowitz&apos;, &apos;email&apos;: &apos;eliot@10gen.com&apos;}
&lt;p&gt;Message: fix &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1366&quot; title=&quot;$in operator not behaving as expect in compound key scenarios&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1366&quot;&gt;&lt;del&gt;SERVER-1366&lt;/del&gt;&lt;/a&gt; test&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/d531ce99d6deea9a21fd332a483987bfc050a366&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/d531ce99d6deea9a21fd332a483987bfc050a366&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="15440" author="aaron" created="Tue, 6 Jul 2010 12:52:03 +0000"  >&lt;p&gt;That won&apos;t use the _id index - you would need an index on {_id.a:1,_id.b:1}&lt;/p&gt;</comment>
                            <comment id="15438" author="aaron" created="Tue, 6 Jul 2010 12:50:57 +0000"  >&lt;p&gt;find({_id : { a:&apos;1&apos;, b: { $in: &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;2&amp;#39;&amp;#93;&lt;/span&gt; }})&lt;/p&gt;

&lt;p&gt;We don&apos;t support this syntax at all.  You want {&apos;_id.a&apos;:&apos;1&apos;,&apos;_id.b&apos;:{$in:&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;2&amp;#39;&amp;#93;&lt;/span&gt;}}.&lt;/p&gt;</comment>
                            <comment id="15436" author="eliot" created="Tue, 6 Jul 2010 12:39:35 +0000"  >&lt;p&gt;See jstests/in5.js&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>9.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 6 Jul 2010 12:39:35 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        13 years, 33 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>ian@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            13 years, 33 weeks, 1 day 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_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>aaron</customfieldvalue>
            <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>tcurdt</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpk4f:</customfieldvalue>

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

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

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