<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:17:54 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-8610] $elemMatch (objects in array) not using index range correctly</title>
                <link>https://jira.mongodb.org/browse/SERVER-8610</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Let&apos;s say I have a collection of 100.000 objects like this:&lt;/p&gt;

&lt;p&gt;{&quot;user&quot;:&quot;bill&quot;,&quot;created&quot;:&quot;2013-10-10&quot;,&quot;updates&quot;:[ &lt;/p&gt;
{&quot;uDate&quot;:&quot;2013-10-10&quot;,...}
&lt;p&gt; , &lt;/p&gt;
{&quot;uDate&quot;:&quot;2013-10-11&quot;,...}
&lt;p&gt;  ]}&lt;/p&gt;

&lt;p&gt;And the following index that should be used on my queries:&lt;/p&gt;

{&quot;updates.uDate&quot;:1}

&lt;p&gt;The query:&lt;/p&gt;

&lt;p&gt;db.users.find({&quot;updates&quot;:{$elemMatch:{&quot;uDate&quot;:{$gte:&quot;2013-10-10&quot;,$lt:&quot;2013-10-12&quot;}}}}).count();&lt;/p&gt;

&lt;p&gt;if I try to query this way, the results are correct but the usage of index is not, that&apos;s why it takes so much time to get results.&lt;br/&gt;
This has a total of 559 results, what is correct, but to try to understand the delay on this query, I tried:&lt;/p&gt;

&lt;p&gt;db.users.find({&quot;updates&quot;:{$elemMatch:{&quot;uDate&quot;:{$gte:&quot;2013-10-10&quot;,$lt:&quot;2013-10-12&quot;}}}}).explain();&lt;/p&gt;

&lt;p&gt;So I got:&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
        &quot;cursor&quot; : &quot;BtreeCursor userDate&quot;,&lt;br/&gt;
        &quot;isMultiKey&quot; : true,&lt;br/&gt;
        &quot;n&quot; : 559,&lt;br/&gt;
        &quot;nscannedObjects&quot; : 434513,&lt;br/&gt;
        &quot;nscanned&quot; : 434513,&lt;br/&gt;
        &quot;nscannedObjectsAllPlans&quot; : 434513,&lt;br/&gt;
        &quot;nscannedAllPlans&quot; : 434513,&lt;br/&gt;
        &quot;scanAndOrder&quot; : false,&lt;br/&gt;
        &quot;indexOnly&quot; : false,&lt;br/&gt;
        &quot;nYields&quot; : 3,&lt;br/&gt;
        &quot;nChunkSkips&quot; : 0,&lt;br/&gt;
        &quot;millis&quot; : 4547,&lt;br/&gt;
        &quot;indexBounds&quot; : {&lt;br/&gt;
                &quot;updates.uDate&quot; : [&lt;br/&gt;
                        [&lt;br/&gt;
                                &quot;2013-10-10&quot;,&lt;br/&gt;
                                {&lt;/p&gt;

&lt;p&gt;                                }&lt;br/&gt;
                        ]&lt;br/&gt;
                ]&lt;br/&gt;
        },&lt;br/&gt;
        &quot;server&quot; : &quot;fzdv1:27017&quot;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;After thinking a lot, I could not realise why the index does not have an End (2013-10-12), just a Start (2013-10-10).. a RANGE.&lt;br/&gt;
It could be because it&apos;s a MultiKey index, so what about forcing the index to work as expected:&lt;/p&gt;

&lt;p&gt;db.users.find().min( &lt;/p&gt;
{&quot;updates.uDate&quot;:&quot;2013-10-10&quot;}
&lt;p&gt; ).max( &lt;/p&gt;
{&quot;updates.uDate&quot;:&quot;2013-10-12&quot;}
&lt;p&gt; ).hint( &lt;/p&gt;
{&quot;updates.uDate&quot;:1}
&lt;p&gt;).explain();&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
        &quot;cursor&quot; : &quot;BtreeCursor userDate&quot;,&lt;br/&gt;
        &quot;isMultiKey&quot; : true,&lt;br/&gt;
        &quot;n&quot; : 559,&lt;br/&gt;
        &quot;nscannedObjects&quot; : 559,&lt;br/&gt;
        &quot;nscanned&quot; : 560,&lt;br/&gt;
        &quot;nscannedObjectsAllPlans&quot; : 559,&lt;br/&gt;
        &quot;nscannedAllPlans&quot; : 560,&lt;br/&gt;
        &quot;scanAndOrder&quot; : false,&lt;br/&gt;
        &quot;indexOnly&quot; : false,&lt;br/&gt;
        &quot;nYields&quot; : 0,&lt;br/&gt;
        &quot;nChunkSkips&quot; : 0,&lt;br/&gt;
        &quot;millis&quot; : 9,&lt;br/&gt;
        &quot;indexBounds&quot; : {&lt;br/&gt;
                &quot;start&quot; : &lt;/p&gt;
{
                        &quot;updates.uDate&quot; : &quot;2013-10-10&quot;
                }
&lt;p&gt;,&lt;br/&gt;
                &quot;end&quot; : &lt;/p&gt;
{
                        &quot;updates.uDate&quot; : &quot;2013-10-12&quot;
                }
&lt;p&gt;        },&lt;br/&gt;
        &quot;server&quot; : &quot;fzdv1:27017&quot;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;Perfect..it worked really fast and with a correct result of 559 objects. My &quot;workaround&quot; would solve my problem but not yet.&lt;br/&gt;
What I need is to use aggregate function so that I can $unwind the &quot;updates.uDate&quot;. &lt;br/&gt;
Using $match produces the same index error/delay and, as far as I know, there is no way to force index range (&quot;hint&quot;/&quot;min&quot;/&quot;max&quot;) on an aggregate $match.&lt;/p&gt;

&lt;p&gt;Because of that, my only solution is to break my users collection into two, &quot;users&quot; and &quot;users_updates&quot;. Then I could use something like:&lt;/p&gt;

&lt;p&gt;db.users.find({&quot;created&quot;:{$gte:&quot;2013-10-10&quot;,$lt:&quot;2013-10-12&quot;}}).explain();&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
        &quot;cursor&quot; : &quot;BtreeCursor created&quot;,&lt;br/&gt;
        &quot;isMultiKey&quot; : false,&lt;br/&gt;
        &quot;n&quot; : 126,&lt;br/&gt;
        &quot;nscannedObjects&quot; : 126,&lt;br/&gt;
        &quot;nscanned&quot; : 126,&lt;br/&gt;
        &quot;nscannedObjectsAllPlans&quot; : 126,&lt;br/&gt;
        &quot;nscannedAllPlans&quot; : 126,&lt;br/&gt;
        &quot;scanAndOrder&quot; : false,&lt;br/&gt;
        &quot;indexOnly&quot; : false,&lt;br/&gt;
        &quot;nYields&quot; : 0,&lt;br/&gt;
        &quot;nChunkSkips&quot; : 0,&lt;br/&gt;
        &quot;millis&quot; : 8,&lt;br/&gt;
        &quot;indexBounds&quot; : &lt;/p&gt;
{
                &quot;created&quot; : [
                        [
                                &quot;2013-10-10&quot;,
                                &quot;2013-10-12&quot;
                        ]
                ]
        }
&lt;p&gt;,&lt;br/&gt;
        &quot;server&quot; : &quot;fzdv1:27017&quot;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;Why $elemMatch queries only works with indexes (range - start/end) as expected when forced to? Why querying objects in an array of objects does not uses indexes as normal queries since it is technicaly possible, as shown above?&lt;/p&gt;

&lt;p&gt;Here is the query that would solve my problem if it worked properly with its index range (start/END).&lt;/p&gt;

&lt;p&gt;db.users.aggregate(&lt;br/&gt;
  {$match   : {&quot;updates&quot;:{$elemMatch:{&quot;uDate&quot;:{$gte:&quot;2013-10-10&quot;,$lt:&quot;2013-10-12&quot;}}}}},&lt;br/&gt;
  {$unwind  : &quot;$updates&quot;},&lt;br/&gt;
  {$project : {&quot;updates.uDate&quot;:1}},&lt;br/&gt;
  {$match   : {&quot;updates.uDate&quot;:{$gte:&quot;2013-10-10&quot;,$lte:&quot;2013-10-12&quot;}}},&lt;br/&gt;
  {$sort    : {&quot;updates.uDate&quot;:1}}&lt;br/&gt;
);&lt;/p&gt;

&lt;p&gt;Am I missing something or it&apos;s a real issue?&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</description>
                <environment>Windows Server 2008 R2</environment>
        <key id="65691">SERVER-8610</key>
            <summary>$elemMatch (objects in array) not using index range correctly</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="aaron">Aaron Staple</assignee>
                                    <reporter username="jemanso">Eduardo Manso</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Feb 2013 06:18:21 +0000</created>
                <updated>Mon, 27 Nov 2017 17:50:25 +0000</updated>
                            <resolved>Tue, 26 Feb 2013 21:36:41 +0000</resolved>
                                    <version>2.2.3</version>
                    <version>2.4.0-rc0</version>
                                                    <component>Querying</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="276537" author="aaron" created="Tue, 26 Feb 2013 21:36:03 +0000"  >&lt;p&gt;Eduardo,&lt;/p&gt;

&lt;p&gt;You have proposed that the query { a:{ $elemMatch:{ b:&lt;/p&gt;
{ $gte:1, $lte:10 }
&lt;p&gt; } } } use the index bounds between 1 and 10 on index &lt;/p&gt;
{ &apos;a.b&apos;:1 }
&lt;p&gt;.  This is functionally incorrect under the current query semantics.  For example the query { a:{ $elemMatch:{ b:&lt;/p&gt;
{ $gte:1, $lte:10 }
&lt;p&gt; } } } has been defined to match the document { a:[ &lt;/p&gt;
{ b:[ 0, 11 ] }
&lt;p&gt; ] }.  As you can see, one value in the &apos;a&apos; array contains both a &apos;b&apos; value &amp;gt;= 1 and a &apos;b&apos; value &amp;lt;= 10.  Applying index bounds on &apos;a.b&apos; between 1 and 10 would fail to match this document.&lt;/p&gt;

&lt;p&gt;The plan of record for handling this situation remains &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6050&quot; title=&quot;Consider allowing $elemMatch applied to non arrays&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6050&quot;&gt;&lt;del&gt;SERVER-6050&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="270795" author="jemanso" created="Wed, 20 Feb 2013 07:43:38 +0000"  >&lt;p&gt;Ok, I&apos;ve tried your query and it works perfect, the result is correct and it uses the index as expected, but that&apos;s a weird workaround, don&apos;t you think so?&lt;/p&gt;

&lt;p&gt;&quot;upDate&quot; is a property that is supposed to hold one date, only one, turning it into an array would be a workaround, not a plausible solution.&lt;/p&gt;

&lt;p&gt;Anyway, that&apos;s not the point, I&apos;ll use the &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6050&quot; title=&quot;Consider allowing $elemMatch applied to non arrays&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6050&quot;&gt;&lt;del&gt;SERVER-6050&lt;/del&gt;&lt;/a&gt; example to get to it.&lt;/p&gt;

&lt;p&gt;According to your suggestion, I should wait for the possible &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6050&quot; title=&quot;Consider allowing $elemMatch applied to non arrays&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6050&quot;&gt;&lt;del&gt;SERVER-6050&lt;/del&gt;&lt;/a&gt; improvement&quot; but, in my opinion, &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6050&quot; title=&quot;Consider allowing $elemMatch applied to non arrays&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6050&quot;&gt;&lt;del&gt;SERVER-6050&lt;/del&gt;&lt;/a&gt; is neither a workaround nor an improvement, it&apos;s a mistake.&lt;/p&gt;

&lt;p&gt;The $elemMatch tag, as it&apos;s name says, is intended to match an element in an array, so making &quot;$elemMatch&quot; working with anything different from a ARRAY would be a mistake.&lt;/p&gt;

&lt;p&gt;Let&apos;s get &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6050&quot; title=&quot;Consider allowing $elemMatch applied to non arrays&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6050&quot;&gt;&lt;del&gt;SERVER-6050&lt;/del&gt;&lt;/a&gt; example:&lt;/p&gt;

&lt;p&gt;document - { a:[ &lt;/p&gt;
{ b:5 }
&lt;p&gt;, &lt;/p&gt;
{ b:15 }
&lt;p&gt; ] }&lt;br/&gt;
query - { &apos;a.b&apos;:{ $elemMatch:&lt;/p&gt;
{ $gte:1, $lte:10 }
&lt;p&gt; } }&lt;/p&gt;

&lt;p&gt;&quot;b&quot; is not an array, so it&apos;s pretty understandable why this query doesn&apos;t work, and it really should not.&lt;/p&gt;

&lt;p&gt;So, let&apos;s use the logic here. &quot;a&quot; is an array, so, keeping our logic, the correct query would be:&lt;/p&gt;

&lt;p&gt;query - { &apos;a&apos;:{ $elemMatch:{ &quot;b&quot;:{$gte:1, $lte:10} } } }&lt;/p&gt;

&lt;p&gt;Now $elemMatch is related to &quot;a&quot; and the condition &lt;/p&gt;
{gte/lte}
&lt;p&gt; is related to &quot;b&quot;.&lt;/p&gt;

&lt;p&gt;Applying the &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6050&quot; title=&quot;Consider allowing $elemMatch applied to non arrays&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6050&quot;&gt;&lt;del&gt;SERVER-6050&lt;/del&gt;&lt;/a&gt; improvement&quot; does not make any sense, but, using the right query does, and, in fact, this query already WORKS, and THAT&apos;S THE POINT! It works, the result is correct, but it is slow because it not uses the index RANGE as it should. It finds and uses the correct index &lt;/p&gt;
{&quot;a.b&quot;:1}
&lt;p&gt; , it applies the &quot;b:{$gte:1}&quot; condition on it and, for some crazy and not logical reason, it forgets to apply {b:{lte:10}} condition when it&apos;s scanning the index.&lt;/p&gt;

&lt;p&gt;Resuming, my question is: &lt;/p&gt;

&lt;p&gt;What is the most plausible step now? Make mongo works with this weird query { &apos;a.b&apos;:{ $elemMatch:&lt;/p&gt;
{ $gte:1, $lte:10 }
&lt;p&gt; } }, or fix the index issue on an query that seems to be more correct { &apos;a&apos;:{ $elemMatch:{ &quot;b&quot;:{$gte:1, $lte:10} } } }, and the most important thing, that already works!!&lt;/p&gt;

&lt;p&gt;What I am asking here is not for a new feature or a workaround, I&apos;m asking for an &quot;improvement&quot; or a &quot;fix&quot; on how index works with {b:{$gte:1, $lte:10}} when &quot;b&quot; is an element of an array. In my point of view, since $elemMatch is explicitly assigned to &quot;a&quot;, any queries to &quot;b&quot; (an element of &quot;a&quot;) should behave like it was independent, not matter if is on root or inside an array, and, as I&apos;ve had proved before, it is technicaly possible as shown bellow: &lt;/p&gt;

&lt;p&gt;db.xxx.find().min( &lt;/p&gt;
{&quot;a.b&quot;:&quot;2013-10-10&quot;}
&lt;p&gt; ).max( &lt;/p&gt;
{&quot;a.b&quot;:&quot;2013-10-12&quot;}
&lt;p&gt; ).hint( &lt;/p&gt;
{&quot;a.b&quot;:1}
&lt;p&gt;).explain();&lt;/p&gt;

&lt;p&gt;Another good improvement could be allowing the above query to work on an aggregate function (hint/min/max).&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                            <comment id="270246" author="aaron" created="Tue, 19 Feb 2013 18:59:23 +0000"  >&lt;p&gt;Hi Eduardo - I think your usage of $elemMatch is a little different from what you want.&lt;/p&gt;

&lt;p&gt;For this to work you&apos;ll need to change your uDate fields to arrays and use this modified query.  Note that if &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6050&quot; title=&quot;Consider allowing $elemMatch applied to non arrays&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6050&quot;&gt;&lt;del&gt;SERVER-6050&lt;/del&gt;&lt;/a&gt; is implemented uDate will no longer need to be an array.&lt;/p&gt;

&lt;p&gt;Here&apos;s a demo:&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; = db.c;&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;c.drop();&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;&amp;nbsp;&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;// Note that the uDate dates are now contained in arrays.                             &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;c.save( {&quot;user&quot;:&quot;bill&quot;,&quot;created&quot;:&quot;2013-10-10&quot;,&quot;updates&quot;:[ {&quot;uDate&quot;:[&quot;2013-10-10&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;{&quot;uDate&quot;:[&quot;2013-10-11&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;&amp;nbsp;&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;c.ensureIndex( {&quot;updates.uDate&quot;:1} );&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;&amp;nbsp;&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;// This is the query from the ticket.                                                 &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;printjson( c.find({&quot;updates&quot;:{$elemMatch:{&quot;uDate&quot;:{$gte:&quot;2013-10-10&quot;,$lt:&quot;2013-10-12&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;}}}}).explain() );&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;&amp;nbsp;&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;// This is a query which will provide desired index bounds.                           &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;printjson( c.find({&quot;updates.uDate&quot;:{$elemMatch:{$gte:&quot;2013-10-10&quot;,$lt:&quot;2013-10-12&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;).explain() );&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;&amp;nbsp;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="155427">SERVER-15086</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>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, 19 Feb 2013 18:59:23 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            10 years, 51 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="10022"><![CDATA[Windows]]></customfieldvalue>

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

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>43345</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_10166" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Tests Written</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10154"><![CDATA[Complete]]></customfieldvalue>

                        </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|hrj1xj:</customfieldvalue>

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