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

db.Eval(evalArgs) not working from c sharp

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Blocker - P1 Blocker - P1
    • None
    • None
    • None
    • Windows

    Description

      Hi,
      I am unable to work with db.Eval function.
      After passing BsonDocument in EvalArgs, it throws "type cast error".

      My code:
      EvalArgs ea = new EvalArgs();
      BsonJavaScript bjs = new BsonJavaScript("function()

      { return db.bar.count(); }

      ");
      ea.Code = bjs;
      db.Eval(ea);

      This returns nothing, while the code runs in mongo shell when directly executed.

      Thanks
      Anurag

      Attachments

        Activity

          People

            Unassigned Unassigned
            anuaquarius Anurag
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: