Skip to content

Commit

Permalink
SERVER-24766 Rename error code 15999 to InvalidPipelineOperator
Browse files Browse the repository at this point in the history
  • Loading branch information
GeertBosch committed Jul 13, 2016
1 parent a751344 commit b62dcab
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
4 changes: 3 additions & 1 deletion jstests/aggregation/bugs/server11675.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ var server11675 = function() {
assertErrorCode(t, [{$sort: {text: 1}}, {$match: {$text: {$search: 'apple banana'}}}], 17313);

// wrong $stage, but correct position
assertErrorCode(t, [{$project: {searchValue: {$text: {$search: 'apple banana'}}}}], 15999);
assertErrorCode(t,
[{$project: {searchValue: {$text: {$search: 'apple banana'}}}}],
ErrorCodes.InvalidPipelineOperator);
assertErrorCode(t, [{$sort: {$text: {$search: 'apple banana'}}}], 17312);
};
server11675();
6 changes: 3 additions & 3 deletions jstests/aggregation/bugs/server6238.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ c.insert({a: 1});

// assert that we get the proper error in both $project and $group
assertErrorCode(c, {$project: {$a: "$a"}}, 16410);
assertErrorCode(c, {$project: {a: {$b: "$a"}}}, 15999);
assertErrorCode(c, {$project: {a: {"$b": "$a"}}}, 15999);
assertErrorCode(c, {$project: {a: {$b: "$a"}}}, ErrorCodes.InvalidPipelineOperator);
assertErrorCode(c, {$project: {a: {"$b": "$a"}}}, ErrorCodes.InvalidPipelineOperator);
assertErrorCode(c, {$project: {'a.$b': "$a"}}, 16410);
assertErrorCode(c, {$group: {_id: "$_id", $a: "$a"}}, 15950);
assertErrorCode(c, {$group: {_id: {$a: "$a"}}}, 15999);
assertErrorCode(c, {$group: {_id: {$a: "$a"}}}, ErrorCodes.InvalidPipelineOperator);
3 changes: 1 addition & 2 deletions jstests/aggregation/bugs/server6290.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ t.drop();

t.save({});

// code 15999: invalid operator
var error = 15999;
var error = ErrorCodes.InvalidPipelineOperator;

// $isoDate is an invalid operator.
assertErrorCode(t, {$project: {a: {$isoDate: [{year: 1}]}}}, error);
Expand Down
2 changes: 1 addition & 1 deletion src/mongo/base/error_codes.err
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ error_code("InitialSyncActive", 164)
error_code("ViewDepthLimitExceeded", 165)
error_code("CommandNotSupportedOnView", 166)
error_code("OptionNotSupportedOnView", 167)
error_code("OperatorNotSupportedOnView", 168)
error_code("InvalidPipelineOperator", 168)
error_code("CommandOnShardedViewNotSupportedOnMongos", 169)
error_code("TooManyMatchingDocuments", 170)
error_code("CannotIndexParallelArrays", 171)
Expand Down
2 changes: 1 addition & 1 deletion src/mongo/db/pipeline/expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ intrusive_ptr<Expression> Expression::parseExpression(BSONObj obj, const Variabl
// Look up the parser associated with the expression name.
const char* opName = obj.firstElementFieldName();
auto op = parserMap.find(opName);
uassert(15999,
uassert(ErrorCodes::InvalidPipelineOperator,
str::stream() << "Unrecognized expression '" << opName << "'",
op != parserMap.end());
return op->second(obj.firstElement(), vps);
Expand Down

0 comments on commit b62dcab

Please sign in to comment.