Browse Source

Refs #3045: Fixed accumulator getFactory tests

Mike McCarty 11 years ago
parent
commit
1859e1f4af

+ 5 - 0
lib/pipeline/accumulators/AddToSetAccumulator.js

@@ -27,6 +27,11 @@ proto.getOpName = function getOpName(){
 	return "$addToSet";
 };
 
+proto.getFactory = function getFactory(){
+	return klass;	// using the ctor rather than a separate .create() method
+};
+
+
 proto.contains = function contains(value) {
 	var set = this.set;
 	for (var i = 0, l = set.length; i < l; ++i) {

+ 5 - 0
lib/pipeline/accumulators/FirstAccumulator.js

@@ -21,6 +21,11 @@ proto.getOpName = function getOpName(){
 	return "$first";
 };
 
+proto.getFactory = function getFactory(){
+	return klass;	// using the ctor rather than a separate .create() method
+};
+
+
 proto.processInternal = function processInternal(input, merging) {
 	/* only remember the first value seen */
 	if (!this._haveFirst) {

+ 5 - 0
lib/pipeline/accumulators/PushAccumulator.js

@@ -23,6 +23,11 @@ proto.getOpName = function getOpName(){
 	return "$push";
 };
 
+proto.getFactory = function getFactory(){
+	return klass;	// using the ctor rather than a separate .create() method
+};
+
+
 proto.processInternal = function processInternal(input, merging) {
 	if (!merging) {
 		if (input !== undefined) {