diff --git a/packages/compass-aggregations/src/components/stage-preview/stage-preview.jsx b/packages/compass-aggregations/src/components/stage-preview/stage-preview.jsx index 5cfb07330db..1dad48220fc 100644 --- a/packages/compass-aggregations/src/components/stage-preview/stage-preview.jsx +++ b/packages/compass-aggregations/src/components/stage-preview/stage-preview.jsx @@ -46,7 +46,7 @@ class StagePreview extends Component { } /** - * On the save click, execute the $out. + * On the save click, execute the $out or $merge. */ onSaveDocuments = () => { this.props.runOutStage(this.props.index); diff --git a/packages/compass-aggregations/src/modules/pipeline.js b/packages/compass-aggregations/src/modules/pipeline.js index 177216a4edd..3843c9da446 100644 --- a/packages/compass-aggregations/src/modules/pipeline.js +++ b/packages/compass-aggregations/src/modules/pipeline.js @@ -534,8 +534,7 @@ export const generatePipeline = (state, index) => { if ( stages.length > 0 && - !REQUIRED_AS_FIRST_STAGE.includes(lastStage.stageOperator) && - (lastStage.stageOperator !== MERGE) + !REQUIRED_AS_FIRST_STAGE.includes(lastStage.stageOperator) ) { stages.push({ $limit: state.limit || DEFAULT_SAMPLE_SIZE @@ -627,7 +626,7 @@ const executeStage = (dataService, ns, dispatch, state, index) => { }; /** - * Executes the out stage. + * Executes a pipeline that outputs documents as the last stage. * * @param {DataService} dataService - The data service. * @param {String} ns - The namespace.