|
@@ -13,11 +13,12 @@ var PipelineCommand = module.exports = (function(){
|
|
|
/* try to parse the command; if this fails, then we didn't run */
|
|
/* try to parse the command; if this fails, then we didn't run */
|
|
|
//NOTE: this is different from the mongo implementation. It used to be in the 'run' method that we would parse the pipeline,
|
|
//NOTE: this is different from the mongo implementation. It used to be in the 'run' method that we would parse the pipeline,
|
|
|
//but we decided it would be better to be able to save the parsed command
|
|
//but we decided it would be better to be able to save the parsed command
|
|
|
- this.pPipeline = Pipeline.parseCommand(cmdObj);
|
|
|
|
|
|
|
+ this.pPipeline = klass.Pipeline.parseCommand(cmdObj);
|
|
|
}, base = Object, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
|
|
}, base = Object, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
|
|
|
|
|
|
|
|
- var Pipeline = require('../pipeline/Pipeline'),
|
|
|
|
|
- PipelineD = require('../pipeline/PipelineD');
|
|
|
|
|
|
|
+ //Put these on the class so they can be overriden.
|
|
|
|
|
+ klass.Pipeline = require('../pipeline/Pipeline');
|
|
|
|
|
+ klass.PipelineD = require('../pipeline/PipelineD');
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Execute the pipeline.
|
|
* Execute the pipeline.
|
|
@@ -32,7 +33,7 @@ var PipelineCommand = module.exports = (function(){
|
|
|
* @method runExecute
|
|
* @method runExecute
|
|
|
**/
|
|
**/
|
|
|
proto.runExecute = function runExecute(db, callback){
|
|
proto.runExecute = function runExecute(db, callback){
|
|
|
- var pSource = PipelineD.prepareCursorSource(this.pPipeline, db);
|
|
|
|
|
|
|
+ var pSource = klass.PipelineD.prepareCursorSource(this.pPipeline, db);
|
|
|
return this.executePipeline(this.pPipeline, pSource, callback);
|
|
return this.executePipeline(this.pPipeline, pSource, callback);
|
|
|
};
|
|
};
|
|
|
|
|
|