Browse Source

Merge branch 'release/v0.6.2+2013.12.02'

* release/v0.6.2+2013.12.02:
  Refs #4026: update package.json to use release branch for version v0.6.2+2013.12.02.
  Refs #4103: Updated canonicalize to fall through to a default value for
  Refs #4103: Removed date restriction in mungedb-aggregate
  Refs #3878: update package.json to new version 0.6.2+2013.12.02.

Conflicts:
	package.json
Charles Ezell 11 years ago
parent
commit
f3cbcb9b65
3 changed files with 8 additions and 6 deletions
  1. 6 3
      lib/pipeline/Value.js
  2. 0 1
      lib/pipeline/expressions/SubtractExpression.js
  3. 2 2
      package.json

+ 6 - 3
lib/pipeline/Value.js

@@ -99,9 +99,11 @@ klass.canonicalize = function canonicalize(x) {
 			return 20;
 		case "Array":
 			return 25;
-		case "BinData":
+		case "Binary":
 			return 30;
-		case "jstOID":
+		case "ObjectId":
+			return 35;
+		case "ObjectID":
 			return 35;
 		case "boolean":
 		case "Boolean":
@@ -119,7 +121,8 @@ klass.canonicalize = function canonicalize(x) {
 		case "CodeWScope":
 			return 65;
 		default:
-			throw new Error("Unexpected type in mongodb-aggregate canonicalize");
+			// Default value for Object
+			return 20;  
 	}
 };
 

+ 0 - 1
lib/pipeline/expressions/SubtractExpression.js

@@ -33,6 +33,5 @@ proto.evaluate = function evaluate(doc) {
 	this.checkArgCount(2);
 	var left = this.operands[0].evaluate(doc),
 		right = this.operands[1].evaluate(doc);
-	if (left instanceof Date || right instanceof Date) throw new Error("$subtract does not support dates; code 16376");
 	return left - right;
 };

+ 2 - 2
package.json

@@ -1,6 +1,6 @@
 {
   "name": "mungedb-aggregate",
-  "version": "0.6.1+2013.11.18",
+  "version": "0.6.2+2013.12.02",
   "description": "A JavaScript data aggregation pipeline based on the MongoDB aggregation framework.",
   "author": "Rivera Group <support@riverainc.com>",
   "contributors": [
@@ -15,7 +15,7 @@
     "test": "npm_scripts/test/test.sh"
   },
   "repository": {
-    "url": "git+https://source.rd.rcg.local/git/private/mungedb-aggregate.git#master"
+    "url": "git+https://source.rd.rcg.local/git/private/mungedb-aggregate.git#release/v0.6.2+2013.12.02"
   },
   "keywords": [
     "manipulation",