<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:56:19 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>[JAVA-2104] Add explain() capability for new Java driver API</title>
                <link>https://jira.mongodb.org/browse/JAVA-2104</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;There appears to be no equivalent of the explain() method on the new API&apos;s find() operation, or any other discoverable place in the new API.&lt;/p&gt;</description>
                <environment></environment>
        <key id="263091">JAVA-2104</key>
            <summary>Add explain() capability for new Java driver API</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="TheAndruu">Andrew Cuga [X]</reporter>
                        <labels>
                    </labels>
                <created>Thu, 4 Feb 2016 13:58:22 +0000</created>
                <updated>Tue, 1 Sep 2020 21:21:03 +0000</updated>
                            <resolved>Wed, 8 Nov 2017 14:12:30 +0000</resolved>
                                    <version>3.2.1</version>
                                                    <component>Query Operations</component>
                                        <votes>1</votes>
                                    <watches>8</watches>
                                                                                                                <comments>
                            <comment id="3371249" author="mike.zraly@sophos.com" created="Tue, 1 Sep 2020 21:21:03 +0000"  >&lt;p&gt;I checked:&lt;/p&gt;

&lt;p&gt;Setting notablescan does not cause failures when a plan has a blocking sort.&#160; A query plan that looks like&lt;/p&gt;

&lt;p&gt;SORT&lt;br/&gt;
 SORT_KEY_GENERATOR&lt;br/&gt;
 FETCH&lt;br/&gt;
 IXSCAN index:i_1&lt;/p&gt;

&lt;p&gt;works just fine.&#160; After dropping the index the query plan would have been&#160;&lt;/p&gt;

&lt;p&gt;SORT&lt;br/&gt;
 SORT_KEY_GENERATOR&lt;br/&gt;
 COLLSCAN filter:...&lt;/p&gt;

&lt;p&gt;and that does fail because of the COLLSCAN stage.&lt;/p&gt;

&lt;p&gt;Another observation is that queries with no predicate or the empty predicate {} do NOT trigger a failure when the notablescan option is set.&#160; OT1H this is nice because it lets us scan the entire collection when we need to.&#160; OTOH this is not nice because we might inadvertently leave out the query predicate and notablescan won&apos;t catch that when it&apos;s an error.&lt;/p&gt;

&lt;p&gt;Given the observations above I&apos;d rather have the option of writing an explicit test that checks for SORT and COLLSCAN stages in explain output.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="3370335" author="jeff.yemin" created="Tue, 1 Sep 2020 15:42:38 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=mike.zraly%40sophos.com&quot; class=&quot;user-hover&quot; rel=&quot;mike.zraly@sophos.com&quot;&gt;mike.zraly@sophos.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As an alternative,&#160;&lt;a href=&quot;https://docs.mongodb.com/manual/reference/parameters/#param.notablescan&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://docs.mongodb.com/manual/reference/parameters/#param.notablescan&lt;/a&gt;&#160;may be of use to you.&#160; This will force the server to error if a full collection scan is required to execute a query.&#160; I&apos;m not sure if it also errors on blocking sorts.&lt;/p&gt;</comment>
                            <comment id="3368778" author="ian.springer@gmail.com" created="Mon, 31 Aug 2020 21:18:32 +0000"  >&lt;p&gt;&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/thumbs_up.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;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="3368250" author="mike.zraly@sophos.com" created="Mon, 31 Aug 2020 17:40:56 +0000"  >&lt;p&gt;Not sure if anyone will see this, but I should point out that it is helpful to be able to execute explain() in Java test code to make sure we are not executing a COLLSCAN or a blocking SORT, understanding that the test case has to have enough variety of documents in the database to get a realistic query plan.&lt;/p&gt;

&lt;p&gt;In any case, if we&apos;re expected to use the .modifiers() method to request explain output, can we please not deprecate that method?&lt;/p&gt;</comment>
                            <comment id="1164051" author="theandruu" created="Thu, 4 Feb 2016 19:27:22 +0000"  >&lt;p&gt;I&apos;m happy as long as the capability exists, as you point out it does.  Thanks for the code snippet showing how to use the &quot;$explain&quot; modifier.  I was trying to supply modifiers such as this but couldn&apos;t guess the syntax / find it in the documentation.&lt;/p&gt;

&lt;p&gt;Then again, as we&apos;re on 3.2.1, it looks like we&apos;ll need to wait to run `explain()` in Java as the issue points out it&apos;s being ignored.  Thanks for pointing that issue out and for the help!&lt;/p&gt;</comment>
                            <comment id="1163776" author="jeff.yemin" created="Thu, 4 Feb 2016 16:56:44 +0000"  >&lt;p&gt;Hi Andrew,&lt;/p&gt;

&lt;p&gt;It&apos;s true that the new CRUD API does not include helpers for explain.  The justification is provided in &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst#q-a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;the specification Q &amp;amp; A&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;As mentioned in the specification, you can continue to use the &quot;$explain&quot; modifier for this, e.g.&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;   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;collection.find().modifiers(&lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;new&lt;/span&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; Document(&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;$explain&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;true&lt;/span&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;)).first();&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;Alternatively, you can execute the &lt;a href=&quot;https://docs.mongodb.org/manual/reference/command/explain/#dbcmd.explain&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;explain command&lt;/a&gt; directly via MongoDatabase.runCommand.&lt;/p&gt;

&lt;p&gt;While investigating this issue, I discovered two other issues:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-2105&quot; title=&quot;&amp;quot;$explain&amp;quot; in FindOptions.modifiers ignored when connected to 3.2 server&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-2105&quot;&gt;&lt;del&gt;JAVA-2105&lt;/del&gt;&lt;/a&gt;: The $explain modifier is ignored when connected to a server with version &amp;gt;= 3.2&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-7096&quot; title=&quot;Add reference to find command in explain command documentation&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-7096&quot;&gt;&lt;del&gt;DOCS-7096&lt;/del&gt;&lt;/a&gt;: The explain command documentation does not mention the find command introduced in the 3.2 server&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;If you still feel strongly that drivers should provide helpers for explain, please make a request in the &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;DRIVERS&lt;/a&gt; Jira project.&lt;/p&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                                                <inwardlinks description="backports">
                                        <issuelink>
            <issuekey id="530660">DOCS-11634</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="263130">JAVA-2105</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="346656">JAVA-2427</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hsi24v:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>