Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-1840

How to use “find” Shell

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      I write some code for run shell

      var args = new EvalArgs

      { Args = Params.ToArray(), Code = js }

      ;
      var result = mongoDb.Eval(args);
      txtResult.Text = result.ToJson(MongoHelper.JsonWriterSettings);

      When I run shell db.GroupTest.find({}); via C#.
      the result looks like

      {
      "_mongo" :

      { "slaveOk" : false, "host" : "EMBEDDED" }

      ,
      "_db" : {
      "_mongo" :

      { "slaveOk" : false, "host" : "EMBEDDED" }

      ,
      "_name" : "MongoBooster"
      },
      "_collection" : {
      "_mongo" :

      { "slaveOk" : false, "host" : "EMBEDDED" }

      ,
      "_db" : {
      "_mongo" :

      { "slaveOk" : false, "host" : "EMBEDDED" }

      ,
      "_name" : "MongoBooster"
      },
      "_shortName" : "GroupTest",
      "_fullName" : "MongoBooster.GroupTest"
      },
      "_ns" : "MongoBooster.GroupTest",
      "_query" : { },
      "_fields" : null,
      "_limit" : 0.0,
      "_skip" : 0.0,
      "_batchSize" : 0.0,
      "_options" : 0.0,
      "_cursor" : null,
      "_numReturned" : 0.0,
      "_special" : false
      }

      what I really want is the dataset records. How can I do it?Thank you.
      The code below will return what I want,but , I want to get the result without use toArray() method,just like mongo.exe
      var c = db.GroupTest.find({});
      return c.toArray();

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            MagicHu Hu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: