Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-6649

should aggregate shell helper throw on error?

    • Type: Icon: Question Question
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.3.2
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • None
    • Minor Change

      Some shell helpers throw when a server error is encountered (eg find, group, mapReduce). The aggregate shell helper does not, instead returning a document with ok:0.

      Test

      t = db.t;
      t.drop();
      
      // Invalid matcher syntax.
      printjson( t.aggregate( { $match:{ a:{ $mod:[ 0 /* invalid */, 0 ] } } } ) );
      

      Result

      { "errmsg" : "exception: mod can't be 0", "code" : 10073, "ok" : 0 }
      

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            aaron Aaron Staple
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: