<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:40:49 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[CSHARP-1840] How to use &#8220;find&#8221; Shell </title>
                <link>https://jira.mongodb.org/browse/CSHARP-1840</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;I write some code for run shell&lt;/p&gt;

&lt;p&gt;                var args = new EvalArgs &lt;/p&gt;
{ Args = Params.ToArray(), Code = js }
&lt;p&gt;;&lt;br/&gt;
                var result = mongoDb.Eval(args);&lt;br/&gt;
                txtResult.Text = result.ToJson(MongoHelper.JsonWriterSettings);&lt;/p&gt;

&lt;p&gt;When I run shell  db.GroupTest.find({}); via C#.&lt;br/&gt;
the result looks like&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
  &quot;_mongo&quot; : &lt;/p&gt;
{
    &quot;slaveOk&quot; : false,
    &quot;host&quot; : &quot;EMBEDDED&quot;
  }
&lt;p&gt;,&lt;br/&gt;
  &quot;_db&quot; : {&lt;br/&gt;
    &quot;_mongo&quot; : &lt;/p&gt;
{
      &quot;slaveOk&quot; : false,
      &quot;host&quot; : &quot;EMBEDDED&quot;
    }
&lt;p&gt;,&lt;br/&gt;
    &quot;_name&quot; : &quot;MongoBooster&quot;&lt;br/&gt;
  },&lt;br/&gt;
  &quot;_collection&quot; : {&lt;br/&gt;
    &quot;_mongo&quot; : &lt;/p&gt;
{
      &quot;slaveOk&quot; : false,
      &quot;host&quot; : &quot;EMBEDDED&quot;
    }
&lt;p&gt;,&lt;br/&gt;
    &quot;_db&quot; : {&lt;br/&gt;
      &quot;_mongo&quot; : &lt;/p&gt;
{
        &quot;slaveOk&quot; : false,
        &quot;host&quot; : &quot;EMBEDDED&quot;
      }
&lt;p&gt;,&lt;br/&gt;
      &quot;_name&quot; : &quot;MongoBooster&quot;&lt;br/&gt;
    },&lt;br/&gt;
    &quot;_shortName&quot; : &quot;GroupTest&quot;,&lt;br/&gt;
    &quot;_fullName&quot; : &quot;MongoBooster.GroupTest&quot;&lt;br/&gt;
  },&lt;br/&gt;
  &quot;_ns&quot; : &quot;MongoBooster.GroupTest&quot;,&lt;br/&gt;
  &quot;_query&quot; : { },&lt;br/&gt;
  &quot;_fields&quot; : null,&lt;br/&gt;
  &quot;_limit&quot; : 0.0,&lt;br/&gt;
  &quot;_skip&quot; : 0.0,&lt;br/&gt;
  &quot;_batchSize&quot; : 0.0,&lt;br/&gt;
  &quot;_options&quot; : 0.0,&lt;br/&gt;
  &quot;_cursor&quot; : null,&lt;br/&gt;
  &quot;_numReturned&quot; : 0.0,&lt;br/&gt;
  &quot;_special&quot; : false&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;what I really want is the dataset records. How can I do it?Thank you.&lt;br/&gt;
The code below will return what I want,but , I want to get the result without use toArray() method,just like mongo.exe &lt;br/&gt;
var c = db.GroupTest.find({}); &lt;br/&gt;
return c.toArray(); &lt;/p&gt;</description>
                <environment></environment>
        <key id="334753">CSHARP-1840</key>
            <summary>How to use &#8220;find&#8221; Shell </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="robert@mongodb.com">Robert Stam</assignee>
                                    <reporter username="MagicHu">Hu</reporter>
                        <labels>
                            <label>question</label>
                    </labels>
                <created>Tue, 29 Nov 2016 02:43:45 +0000</created>
                <updated>Fri, 5 Apr 2019 13:58:45 +0000</updated>
                            <resolved>Wed, 30 Nov 2016 18:07:00 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1446034" author="rstam" created="Wed, 30 Nov 2016 18:06:36 +0000"  >&lt;p&gt;When using a driver you should always use the API provided by that driver, not the API provided by the shell.&lt;/p&gt;

&lt;p&gt;Also, use of eval is deprecated and it is likely to be removed entirely from the server at some point.&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|hssb1b:</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>