summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/expression.cpp
diff options
context:
space:
mode:
authormatt dannenberg <matt.dannenberg@10gen.com>2013-09-09 14:09:15 -0400
committermatt dannenberg <matt.dannenberg@10gen.com>2013-09-09 14:09:32 -0400
commita6f74a5a6e0691488ac372ee594ed18960488040 (patch)
treea0e6550bff47d0516bba44acb19a9c4f6848f106 /src/mongo/db/pipeline/expression.cpp
parentabb240549a0174f52d1ee18a8866e0ad65a10881 (diff)
downloadmongo-a6f74a5a6e0691488ac372ee594ed18960488040.tar.gz
SERVER-10086 print typeName rather than type number on type error in $set operators
Diffstat (limited to 'src/mongo/db/pipeline/expression.cpp')
-rw-r--r--src/mongo/db/pipeline/expression.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mongo/db/pipeline/expression.cpp b/src/mongo/db/pipeline/expression.cpp
index edd418d8102..794828a1776 100644
--- a/src/mongo/db/pipeline/expression.cpp
+++ b/src/mongo/db/pipeline/expression.cpp
@@ -2182,10 +2182,10 @@ namespace {
}
uassert(17048, str::stream() << "both operands of $setDifference must be arrays. First "
- << "argument is of type: " << lhs.getType(),
+ << "argument is of type: " << typeName(lhs.getType()),
lhs.getType() == Array);
uassert(17049, str::stream() << "both operands of $setDifference must be arrays. Second "
- << "argument is of type: " << rhs.getType(),
+ << "argument is of type: " << typeName(rhs.getType()),
rhs.getType() == Array);
ValueSet rhsSet = arrayToSet(rhs);
@@ -2222,7 +2222,8 @@ namespace {
for (size_t i = 0; i < n; i++) {
const Value nextEntry = vpOperand[i]->evaluateInternal(vars);
uassert(17044, str::stream() << "All operands of $setEquals must be arrays. One "
- << "argument is of type: " << nextEntry.getType(),
+ << "argument is of type: "
+ << typeName(nextEntry.getType()),
nextEntry.getType() == Array);
if (i == 0) {
@@ -2254,7 +2255,8 @@ namespace {
return Value(BSONNULL);
}
uassert(17047, str::stream() << "All operands of $setIntersection must be arrays. One "
- << "argument is of type: " << nextEntry.getType(),
+ << "argument is of type: "
+ << typeName(nextEntry.getType()),
nextEntry.getType() == Array);
if (i == 0) {
@@ -2300,10 +2302,10 @@ namespace {
const Value rhs = vpOperand[1]->evaluateInternal(vars);
uassert(17046, str::stream() << "both operands of $setIsSubset must be arrays. First "
- << "argument is of type: " << lhs.getType(),
+ << "argument is of type: " << typeName(lhs.getType()),
lhs.getType() == Array);
uassert(17042, str::stream() << "both operands of $setIsSubset must be arrays. Second "
- << "argument is of type: " << rhs.getType(),
+ << "argument is of type: " << typeName(rhs.getType()),
rhs.getType() == Array);
const vector<Value>& potentialSubset = lhs.getArray();
@@ -2336,7 +2338,7 @@ namespace {
return Value(BSONNULL);
}
uassert(17043, str::stream() << "All operands of $setUnion must be arrays. One argument"
- << " is of type: " << newEntries.getType(),
+ << " is of type: " << typeName(newEntries.getType()),
newEntries.getType() == Array);
unionedSet.insert(newEntries.getArray().begin(), newEntries.getArray().end());