Browse Source

EAGLESIX-3079: OutDocumentSource. Verify interface still works.

Jason Walton 11 years ago
parent
commit
1e5dc34246
1 changed files with 8 additions and 2 deletions
  1. 8 2
      lib/pipeline/documentSources/OutDocumentSource.js

+ 8 - 2
lib/pipeline/documentSources/OutDocumentSource.js

@@ -10,13 +10,13 @@ var DocumentSource = require('./DocumentSource');
  * @param [ctx] {ExpressionContext}
  **/
 var OutDocumentSource = module.exports = function OutDocumentSource(outputNs, ctx){
-	if (arguments.length > 2) throw new Error("up to two arg expected");
+	if (arguments.length > 2) throw new Error("up to two args expected");
 	base.call(this, ctx);
 	// defaults
 	this._done = false;
 	this._outputNs = outputNs;
 	this._collectionName = "";
-}, klass = OutDocumentSource, base = require('./DocumentSource'), proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
+}, klass = OutDocumentSource, base = DocumentSource, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
 
 klass.outName = "$out";
 
@@ -47,6 +47,12 @@ klass.createFromJson = function(jsonElement, ctx) {
 	return out;
 };
 
+// SplittableDocumentSource implementation.
+klass.isSplittableDocumentSource = true;
+
+//NeedsMongodDocumentSource implementation
+klass.needsMongodDocumentSource = true;
+
 proto.getDependencies = function(deps) {
 	deps.needWholeDocument = true;
 	return DocumentSource.GetDepsReturn.EXHAUSTIVE;