"use strict";var __extends=this&&this.__extends||function(){var n=function(e,t){n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)if(Object.prototype.hasOwnProperty.call(o,i))r[i]=o[i]};return n(e,t)};return function(e,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();Object.defineProperty(exports,"__esModule",{value:true});exports.AggregateBuilder=void 0;var AggregatePipeline_1=require("../command/AggregatePipeline");var constant_1=require("../common/constant");var util_1=require("../common/util");var AggregateBuilder=function(n){__extends(e,n);function e(t){var r=n.call(this)||this;r.collectionName=t;return r}e.prototype.end=function(){var t={$aggregate:this.done()};return util_1.ActionBuilder.buildDocumentAction(constant_1.DocumentAction.aggregate,this.collectionName,t)};return e}(AggregatePipeline_1.AggregatePipeline);exports.AggregateBuilder=AggregateBuilder;