<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:02:14 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-3156] query projection spec using &apos;true&apos; instead of &apos;1&apos; prevents covered index query</title>
                <link>https://jira.mongodb.org/browse/SERVER-3156</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Update (aaron)&lt;/p&gt;

&lt;p&gt;A query projection a:true should be equivalent to a:1, however specification of a true value prevents covered index queries apparently due to the following line:&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;            if ( ! e.isNumber() )&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;                _hasNonSimple = true;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;Test&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;&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 = 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;c.save( { a:5 } );&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;assert.eq( { a:5 }, c.find( { a:5 }, { _id:0, a:1 } ).toArray()[ 0 ] );&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;assert.eq( { a:5 }, c.find( { a:5 }, { _id:0, a:true } ).toArray()[ 0 ] );&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&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( { a: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;&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;assert.eq( { a:5 }, c.find( { a:5 }, { _id:0, a:1 } ).toArray()[ 0 ] );&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;assert( c.find( { a:5 }, { _id:0, a:1 } ).explain().indexOnly );&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;assert.eq( { a:5 }, c.find( {}, { _id:0, a:true } ).toArray()[ 0 ] );&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&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;// Fails because &apos;true&apos; prevents doing a covered index query.&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;assert( c.find( { a:5 }, { _id:0, a:true } ).explain().indexOnly );&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;


&lt;p&gt;------------------------------------------------------------&lt;/p&gt;

&lt;p&gt;I&apos;m working on a collection consisting of elements like the one below:&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
	&quot;_id&quot; : ObjectId(&quot;4ddec579b47cc1e6024d15a9&quot;),&lt;br/&gt;
	&quot;CH_price&quot; : 0,&lt;br/&gt;
	&quot;TR_price&quot; : 312,&lt;br/&gt;
	&quot;TW_price&quot; : null,&lt;br/&gt;
	&quot;city_code&quot; : &quot;BER&quot;,&lt;br/&gt;
	&quot;currency&quot; : &quot;EUR&quot;,&lt;br/&gt;
	&quot;max_chd&quot; : 0,&lt;br/&gt;
	&quot;max_chd_age&quot; : 0,&lt;br/&gt;
	&quot;max_pax&quot; : 3,&lt;br/&gt;
	&quot;meal&quot; : &quot;BB&quot;,&lt;br/&gt;
	&quot;min_chd&quot; : 0,&lt;br/&gt;
	&quot;min_chd_age&quot; : 0,&lt;br/&gt;
	&quot;min_nights&quot; : 0,&lt;br/&gt;
	&quot;min_pax&quot; : 3,&lt;br/&gt;
	&quot;modified&quot; : ISODate(&quot;2011-05-26T21:24:31.871Z&quot;),&lt;br/&gt;
	&quot;original_room&quot; : &quot;DZ&quot;,&lt;br/&gt;
	&quot;rate_code&quot; : &quot;BER466_DZ&quot;,&lt;br/&gt;
	&quot;room&quot; : &quot;DR&quot;,&lt;br/&gt;
	&quot;source&quot; : &quot;FTI&quot;,&lt;br/&gt;
	&quot;tlc&quot; : &quot;BER&quot;,&lt;br/&gt;
	&quot;valid_from&quot; : ISODate(&quot;2011-05-28T00:00:00Z&quot;),&lt;br/&gt;
	&quot;valid_to&quot; : ISODate(&quot;2011-05-29T00:00:00Z&quot;),&lt;br/&gt;
	&quot;hotel_name&quot; : &quot;EUROSTARS BERLIN&quot;,&lt;br/&gt;
	&quot;category&quot; : 5,&lt;br/&gt;
	&quot;city_name&quot; : &quot;Berl&#237;n&quot;,&lt;br/&gt;
	&quot;geo&quot; : [&lt;br/&gt;
		52.520870208740234,&lt;br/&gt;
		13.389501571655273&lt;br/&gt;
	],&lt;br/&gt;
	&quot;name&quot; : &quot;Standard&quot;,&lt;br/&gt;
	&quot;mh_code&quot; : &quot;BER000AJ&quot;,&lt;br/&gt;
	&quot;mhr_code&quot; : &quot;BER000AJ01&quot;,&lt;br/&gt;
	&quot;hotel_id&quot; : &quot;BER466_CITY&quot;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;which has following indexes defined:&lt;/p&gt;

&lt;p&gt;	{&lt;br/&gt;
		&quot;name&quot; : &quot;&lt;em&gt;id&lt;/em&gt;&quot;,&lt;br/&gt;
		&quot;ns&quot; : &quot;xenia_pricing.mh_rate_prices&quot;,&lt;br/&gt;
		&quot;key&quot; : &lt;/p&gt;
{
			&quot;_id&quot; : 1
		}
&lt;p&gt;	},&lt;br/&gt;
        {&lt;br/&gt;
		&quot;_id&quot; : ObjectId(&quot;4d81c0f20c42d00e2c1a4e18&quot;),&lt;br/&gt;
		&quot;name&quot; : &quot;rate_code_1_min_nights_1_valid_from_1_valid_to_1&quot;,&lt;br/&gt;
		&quot;ns&quot; : &quot;xenia_pricing.mh_rate_prices&quot;,&lt;br/&gt;
		&quot;key&quot; : &lt;/p&gt;
{
			&quot;rate_code&quot; : 1,
			&quot;min_nights&quot; : 1,
			&quot;valid_from&quot; : 1,
			&quot;valid_to&quot; : 1
		}
&lt;p&gt;	}&lt;/p&gt;


&lt;p&gt;After submitting a sample query:&lt;/p&gt;

&lt;p&gt;db.mh_rate_prices.find({ &quot;rate_code&quot; : &lt;/p&gt;
{ &quot;$in&quot; : [&quot;BER466_DZ&quot;] }
&lt;p&gt;, &quot;min_nights&quot; : &lt;/p&gt;
{ &quot;$lte&quot; : 2 }
&lt;p&gt;, &quot;$or&quot; : [{ &quot;valid_from&quot; : { &quot;$lte&quot; : &lt;/p&gt;
{ &quot;$date&quot; : 1309071377602 }
&lt;p&gt; }, &quot;valid_to&quot; : { &quot;$gte&quot; : &lt;/p&gt;
{ &quot;$date&quot; : 1309071377602 }
&lt;p&gt; } }, { &quot;valid_from&quot; : { &quot;$lte&quot; : &lt;/p&gt;
{ &quot;$date&quot; : 1309244177602 }
&lt;p&gt; }, &quot;valid_to&quot; : { &quot;$gte&quot; : &lt;/p&gt;
{ &quot;$date&quot; : 1309244177602 }
&lt;p&gt; } }, { &quot;valid_from&quot; : { &quot;$gte&quot; : &lt;/p&gt;
{ &quot;$date&quot; : 1309071377602 }
&lt;p&gt; }, &quot;valid_to&quot; : { &quot;$lte&quot; : &lt;/p&gt;
{ &quot;$date&quot; : 1309244177602 }
&lt;p&gt; } }] }).explain()&lt;/p&gt;

&lt;p&gt;.explain() indicated that &quot;indexOnly&quot; : false, which suggests that the query was not covered by index:&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
	&quot;clauses&quot; : [&lt;br/&gt;
		{&lt;br/&gt;
			&quot;cursor&quot; : &quot;BtreeCursor valid_from_1_rate_code_1_min_nights_1_valid_to_1&quot;,&lt;br/&gt;
			&quot;nscanned&quot; : 0,&lt;br/&gt;
			&quot;nscannedObjects&quot; : 0,&lt;br/&gt;
			&quot;n&quot; : 0,&lt;br/&gt;
			&quot;millis&quot; : 0,&lt;br/&gt;
			&quot;nYields&quot; : 0,&lt;br/&gt;
			&quot;nChunkSkips&quot; : 0,&lt;br/&gt;
			&quot;isMultiKey&quot; : false,&lt;br/&gt;
			&quot;indexOnly&quot; : false,&lt;br/&gt;
			&quot;indexBounds&quot; : {&lt;br/&gt;
				&quot;valid_from&quot; : [&lt;br/&gt;
					[&lt;br/&gt;
						&lt;/p&gt;
{
							&quot;$minElement&quot; : 1
						}
&lt;p&gt;,&lt;/p&gt;
						{
							&quot;$date&quot; : 1309071377602
						}
&lt;p&gt;					]&lt;br/&gt;
				],&lt;br/&gt;
				&quot;rate_code&quot; : [&lt;br/&gt;
					[&lt;br/&gt;
						&quot;BER466_DZ&quot;,&lt;br/&gt;
						&quot;BER466_DZ&quot;&lt;br/&gt;
					]&lt;br/&gt;
				],&lt;br/&gt;
				&quot;min_nights&quot; : [&lt;br/&gt;
					[&lt;br/&gt;
						-1.7976931348623157e+308,&lt;br/&gt;
						2&lt;br/&gt;
					]&lt;br/&gt;
				],&lt;br/&gt;
				&quot;valid_to&quot; : [&lt;br/&gt;
					[&lt;br/&gt;
						&lt;/p&gt;
{
							&quot;$date&quot; : 1309071377602
						}
&lt;p&gt;,&lt;/p&gt;
						{
							&quot;$maxElement&quot; : 1
						}
&lt;p&gt;					]&lt;br/&gt;
				]&lt;br/&gt;
			}&lt;br/&gt;
		},&lt;br/&gt;
		{&lt;br/&gt;
			&quot;cursor&quot; : &quot;BtreeCursor valid_from_1_rate_code_1_min_nights_1_valid_to_1&quot;,&lt;br/&gt;
			&quot;nscanned&quot; : 0,&lt;br/&gt;
			&quot;nscannedObjects&quot; : 0,&lt;br/&gt;
			&quot;n&quot; : 0,&lt;br/&gt;
			&quot;millis&quot; : 0,&lt;br/&gt;
			&quot;nYields&quot; : 0,&lt;br/&gt;
			&quot;nChunkSkips&quot; : 0,&lt;br/&gt;
			&quot;isMultiKey&quot; : false,&lt;br/&gt;
			&quot;indexOnly&quot; : false,&lt;br/&gt;
			&quot;indexBounds&quot; : {&lt;br/&gt;
				&quot;valid_from&quot; : [&lt;br/&gt;
					[&lt;br/&gt;
						&lt;/p&gt;
{
							&quot;$date&quot; : 1309071377602
						}
&lt;p&gt;,&lt;/p&gt;
						{
							&quot;$date&quot; : 1309244177602
						}
&lt;p&gt;					]&lt;br/&gt;
				],&lt;br/&gt;
				&quot;rate_code&quot; : [&lt;br/&gt;
					[&lt;br/&gt;
						&quot;BER466_DZ&quot;,&lt;br/&gt;
						&quot;BER466_DZ&quot;&lt;br/&gt;
					]&lt;br/&gt;
				],&lt;br/&gt;
				&quot;min_nights&quot; : [&lt;br/&gt;
					[&lt;br/&gt;
						-1.7976931348623157e+308,&lt;br/&gt;
						2&lt;br/&gt;
					]&lt;br/&gt;
				],&lt;br/&gt;
				&quot;valid_to&quot; : [&lt;br/&gt;
					[&lt;br/&gt;
						&lt;/p&gt;
{
							&quot;$date&quot; : 1309244177602
						}
&lt;p&gt;,&lt;/p&gt;
						{
							&quot;$maxElement&quot; : 1
						}
&lt;p&gt;					]&lt;br/&gt;
				]&lt;br/&gt;
			}&lt;br/&gt;
		},&lt;br/&gt;
		{&lt;br/&gt;
			&quot;cursor&quot; : &quot;BtreeCursor rate_code_1_min_nights_1_valid_from_1_valid_to_1&quot;,&lt;br/&gt;
			&quot;nscanned&quot; : 59,&lt;br/&gt;
			&quot;nscannedObjects&quot; : 0,&lt;br/&gt;
			&quot;n&quot; : 0,&lt;br/&gt;
			&quot;millis&quot; : 4,&lt;br/&gt;
			&quot;nYields&quot; : 0,&lt;br/&gt;
			&quot;nChunkSkips&quot; : 0,&lt;br/&gt;
			&quot;isMultiKey&quot; : false,&lt;br/&gt;
			&quot;indexOnly&quot; : false,&lt;br/&gt;
			&quot;indexBounds&quot; : {&lt;br/&gt;
				&quot;rate_code&quot; : [&lt;br/&gt;
					[&lt;br/&gt;
						&quot;BER466_DZ&quot;,&lt;br/&gt;
						&quot;BER466_DZ&quot;&lt;br/&gt;
					]&lt;br/&gt;
				],&lt;br/&gt;
				&quot;min_nights&quot; : [&lt;br/&gt;
					[&lt;br/&gt;
						-1.7976931348623157e+308,&lt;br/&gt;
						2&lt;br/&gt;
					]&lt;br/&gt;
				],&lt;br/&gt;
				&quot;valid_from&quot; : [&lt;br/&gt;
					[&lt;br/&gt;
						&lt;/p&gt;
{
							&quot;$date&quot; : 1309071377602
						}
&lt;p&gt;,&lt;/p&gt;
						{
							&quot;$maxElement&quot; : 1
						}
&lt;p&gt;					]&lt;br/&gt;
				],&lt;br/&gt;
				&quot;valid_to&quot; : [&lt;br/&gt;
					[&lt;br/&gt;
						&lt;/p&gt;
{
							&quot;$minElement&quot; : 1
						}
&lt;p&gt;,&lt;/p&gt;
						{
							&quot;$date&quot; : 1309244177602
						}
&lt;p&gt;					]&lt;br/&gt;
				]&lt;br/&gt;
			}&lt;br/&gt;
		}&lt;br/&gt;
	],&lt;br/&gt;
	&quot;nscanned&quot; : 59,&lt;br/&gt;
	&quot;nscannedObjects&quot; : 0,&lt;br/&gt;
	&quot;n&quot; : 0,&lt;br/&gt;
	&quot;millis&quot; : 4&lt;br/&gt;
}&lt;/p&gt;


&lt;p&gt;What is the reason of that behaviour and how should I define indexes to avoid long response time (up to 5 seconds for some queries)?&lt;/p&gt;</description>
                <environment>ubuntu x64</environment>
        <key id="17582">SERVER-3156</key>
            <summary>query projection spec using &apos;true&apos; instead of &apos;1&apos; prevents covered index query</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="benety.goh@mongodb.com">Benety Goh</assignee>
                                    <reporter username="styniu">Sebastian Styka</reporter>
                        <labels>
                            <label>indexing</label>
                            <label>neweng</label>
                            <label>query_triage</label>
                    </labels>
                <created>Fri, 27 May 2011 07:17:43 +0000</created>
                <updated>Tue, 12 Jul 2016 00:17:33 +0000</updated>
                            <resolved>Wed, 20 Nov 2013 18:24:44 +0000</resolved>
                                    <version>1.8.1</version>
                                    <fixVersion>2.5.5</fixVersion>
                                    <component>Querying</component>
                                        <votes>2</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="459150" author="xgen-internal-githook" created="Wed, 20 Nov 2013 18:09:19 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;benety&apos;, u&apos;name&apos;: u&apos;Benety Goh&apos;, u&apos;email&apos;: u&apos;benety@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3156&quot; title=&quot;query projection spec using &amp;#39;true&amp;#39; instead of &amp;#39;1&amp;#39; prevents covered index query&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3156&quot;&gt;&lt;del&gt;SERVER-3156&lt;/del&gt;&lt;/a&gt; handle projection spec using boolean&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/2640c3e347e752b8819273e329c6d0e705b364b3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/2640c3e347e752b8819273e329c6d0e705b364b3&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="402803" author="kali" created="Wed, 14 Aug 2013 13:34:39 +0000"  >&lt;p&gt;Just got bitten &#8212; badly &#8212; by this one.&lt;/p&gt;</comment>
                            <comment id="111432" author="eliot" created="Thu, 19 Apr 2012 04:43:07 +0000"  >&lt;p&gt;Yeah - we should change that&lt;/p&gt;</comment>
                            <comment id="111128" author="unbeknownst" created="Wed, 18 Apr 2012 14:35:28 +0000"  >&lt;p&gt;What? so you can select fields using either booleans or numbers but the behavior of the index changes depending on the type???&lt;/p&gt;

&lt;p&gt;If I ran:&lt;/p&gt;

&lt;p&gt;    db.userevents.find({_id:ObjectId(&quot;4da41e0738710e13e4000001&quot;)}, {_id:true})&lt;/p&gt;


&lt;p&gt;I get:&lt;/p&gt;
    { &quot;_id&quot; : ObjectId(&quot;4da41e0738710e13e4000001&quot;) }


&lt;p&gt;If I ran:&lt;/p&gt;

&lt;p&gt;   db.userevents.find({_id:ObjectId(&quot;4da41e0738710e13e4000001&quot;)}, {_id:true, g:true})&lt;/p&gt;


&lt;p&gt;I get:&lt;/p&gt;
   { &quot;_id&quot; : ObjectId(&quot;4da41e0738710e13e4000001&quot;), &quot;g&quot; : ObjectId(&quot;4d650bb438710e13d4000001&quot;) }


&lt;p&gt;So obviously the field selection works with booleans, which makes sense to me, as it does on other drivers, but it does not make sense than the type of the selector influences the decision on whether to use the index only to return data or not.&lt;br/&gt;
Are other drivers like this? Should we change in Python from using &quot;True&quot; to use &quot;1&quot; on the field selectors?&lt;/p&gt;</comment>
                            <comment id="111104" author="eliot" created="Wed, 18 Apr 2012 14:06:08 +0000"  >&lt;p&gt;needs to be: &lt;/p&gt;
{ _id : 1 }
&lt;p&gt; &lt;/p&gt;</comment>
                            <comment id="111048" author="unbeknownst" created="Wed, 18 Apr 2012 11:31:27 +0000"  >&lt;p&gt;Could you explain this case:&lt;/p&gt;

&lt;p&gt;&amp;gt; db.userevents.find({_id:ObjectId(&quot;4da41e0738710e13e4000001&quot;)}, {_id:true}).explain()&lt;br/&gt;
{&lt;br/&gt;
        &quot;cursor&quot; : &quot;BtreeCursor &lt;em&gt;id&lt;/em&gt;&quot;,&lt;br/&gt;
        &quot;nscanned&quot; : 1,&lt;br/&gt;
        &quot;nscannedObjects&quot; : 1,&lt;br/&gt;
        &quot;n&quot; : 1,&lt;br/&gt;
        &quot;millis&quot; : 0,&lt;br/&gt;
        &quot;nYields&quot; : 0,&lt;br/&gt;
        &quot;nChunkSkips&quot; : 0,&lt;br/&gt;
        &quot;isMultiKey&quot; : false,&lt;br/&gt;
        &quot;indexOnly&quot; : false,&lt;br/&gt;
        &quot;indexBounds&quot; : &lt;/p&gt;
{
                &quot;_id&quot; : [
                        [
                                ObjectId(&quot;4da41e0738710e13e4000001&quot;),
                                ObjectId(&quot;4da41e0738710e13e4000001&quot;)
                        ]
                ]
        }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;&quot;indexOnly&quot; is false and &quot;nscannedObjects&quot; is 1, which means is not using the index to return the data?&lt;br/&gt;
Our &quot;userevents&quot; docs have 8 fields plus the _id.&lt;/p&gt;

&lt;p&gt;I am using version &quot;2.0.1&quot;.&lt;/p&gt;</comment>
                            <comment id="34756" author="eliot" created="Fri, 27 May 2011 07:47:59 +0000"  >&lt;p&gt;You don&apos;t have any projection in there, so the full documents will be returned, so indexOnly is false.&lt;/p&gt;

&lt;p&gt;Notice in the 2nd case, nscanned=59 and nscannedObjects=0 which indicates it only had to use the index.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="48106">SERVER-6854</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="92029">SERVER-10956</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="32094">SERVER-5189</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="33570" name="server3156.js" size="569" author="benety.goh@mongodb.com" created="Thu, 7 Nov 2013 18:07:52 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 27 May 2011 07:47:59 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        10 years, 13 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            10 years, 13 weeks 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>benety.goh@mongodb.com</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>kali</customfieldvalue>
            <customfieldvalue>styniu</customfieldvalue>
            <customfieldvalue>unbeknownst</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hroz3j:</customfieldvalue>

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

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

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