<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:37:57 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>[CSHARP-832] why does Explain() not work on Find set of methods</title>
                <link>https://jira.mongodb.org/browse/CSHARP-832</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;var result = someCollection.AsQueryable&amp;lt;SomeType&amp;gt;                ().Where(somecondition).Explain();&lt;/p&gt;

&lt;p&gt;the above works where as &lt;/p&gt;

&lt;p&gt;var result = someCollection.FindAs&amp;lt;SomeType&amp;gt;                ().Where(somecondition).Explain();&lt;/p&gt;

&lt;p&gt;will not&lt;/p&gt;

&lt;p&gt;I would expect the explain to be available here as well or did I get something wrong ?&lt;/p&gt;</description>
                <environment></environment>
        <key id="91951">CSHARP-832</key>
            <summary>why does Explain() not work on Find set of methods</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="-1">Unassigned</assignee>
                                    <reporter username="ashutosh">Ashutosh</reporter>
                        <labels>
                            <label>driver</label>
                            <label>question</label>
                    </labels>
                <created>Sat, 28 Sep 2013 21:30:10 +0000</created>
                <updated>Fri, 5 Apr 2019 13:59:37 +0000</updated>
                            <resolved>Sun, 29 Sep 2013 13:34:31 +0000</resolved>
                                    <version>1.8.2</version>
                                                    <component>Documentation</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="432844" author="craiggwilson" created="Sun, 29 Sep 2013 19:55:23 +0000"  >&lt;p&gt;Yes, you can get a look into it.  The resulting type from FindAs is a MongoCursor (&lt;a href=&quot;http://api.mongodb.org/csharp/1.1/html/48c6b240-3c2d-8d12-45e7-5b8b74605769.htm&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://api.mongodb.org/csharp/1.1/html/48c6b240-3c2d-8d12-45e7-5b8b74605769.htm&lt;/a&gt;).  Once you create a MongoCursor, you cannot further filter it&apos;s results.  As such, you specify the query in the FindAs (or Find) call and can then set other things like skip (SetSkip), limit (SetLimit), or call Explain() on it.&lt;/p&gt;

&lt;p&gt;The guidance is this:  If you want to use LINQ, use AsQueryable.  If you don&apos;t, then you either specify your queries by hand using a BsonDocument, or you can use the query builders in the MongoDB.Driver.Builders.  For instance,&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;var query = Query.And(&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;  Query&amp;lt;Person&amp;gt;.GT(x =&amp;gt; x.Age, 20),&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;  Query&amp;lt;Person&amp;gt;.EQ(x =&amp;gt; x.LastName, &quot;Smith&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;   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;var result = collection.FindAs&amp;lt;Person&amp;gt;(query).SetSkip(2).SetLimit(20).Explain();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                            <comment id="432818" author="ashutosh" created="Sun, 29 Sep 2013 13:46:24 +0000"  >&lt;p&gt;When are we supposed to use the Find based methods, is there some guidance on this ?&lt;/p&gt;

&lt;p&gt;Can&apos;t we get a look in to the query that is executed in the second case, since I do expect some query to execute on the server, even if it is a poorly formulated one ? &lt;/p&gt;</comment>
                            <comment id="432815" author="craiggwilson" created="Sun, 29 Sep 2013 13:34:22 +0000"  >&lt;p&gt;Your first example is a LINQ query and your second is not.  Your second has the additional problem of pulling back all the document in the database and filtering on them locally, which is most definitely not what you want to do.  So, if you want to use LINQ, you need to use the AsQueryable entry method.&lt;/p&gt;</comment>
                    </comments>
                    <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|hrt6n3:</customfieldvalue>

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