[SERVER-6649] should aggregate shell helper throw on error? Created: 30/Jul/12  Updated: 14/May/14  Resolved: 18/Dec/12

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 2.3.2

Type: Question Priority: Major - P3
Reporter: Aaron Staple Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to DOCS-1399 shell helper aggregate() throws excep... Closed
is related to SERVER-8805 aggregation $within command: exceptio... Closed
Backwards Compatibility: Minor Change
Participants:

 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 }



 Comments   
Comment by auto [ 18/Dec/12 ]

Author:

{u'date': u'2012-12-18T18:26:26Z', u'email': u'mathias@10gen.com', u'name': u'Mathias Stearn'}

Message: SERVER-6649 have agg helper throw exceptions and fix tests accordingly

Most of this was done by Samantha Ritter. Thanks!
Branch: master
https://github.com/mongodb/mongo/commit/68f6dcd2c36f3d888feed5a3b63a4e3cdf2b2138

Comment by Mathias Stearn [ 01/Aug/12 ]

FYI - the hardest part of this will be fixing all of the tests that check for specific errors. Given that, I think it is best to push this off until 2.3 when we have time to do something nicer.

Comment by Aaron Staple [ 30/Jul/12 ]

Scheduled in rc1 for triage.

Generated at Thu Feb 08 03:12:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.