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

should aggregate shell helper throw on error?

    XMLWordPrintable

    Details

    • Type: Question
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.2
    • Component/s: Aggregation Framework
    • Labels:
      None
    • Backwards Compatibility:
      Minor Change

      Description

      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 }

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: