Kaynağa Gözat

EAGLESIX-2712: minor changes

Jake Delaney 11 yıl önce
ebeveyn
işleme
3830e66566
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 2 2
      lib/pipeline/expressions/MapExpression.js

+ 2 - 2
lib/pipeline/expressions/MapExpression.js

@@ -83,11 +83,11 @@ proto.evaluateInternal = function evaluateInternal(vars) {
 	}
 
 	if(!(inputVal instanceof Array)) {
-		throw new Error("Input to $map must be an Array, not a " + typeof inputVal + " 16883");
+		throw new Error("Uassert 16883: Input to $map must be an Array, not a " + typeof inputVal);
 	}
 
 	if(inputVal.length === 0) {
-		return [];
+		return inputVal;
 	}
 
 	// Diverge from Mongo source here, as Javascript has a builtin map operator.