UNPKG

reveal-sdk-node

Version:

RevealBI Node.js SDK

76 lines (75 loc) 2.73 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RVMongoDBDataSourceItem = void 0; const RVDataSourceItem_1 = require("../AbstractClasses/RVDataSourceItem"); const RVMongoDBDataSource_1 = require("./RVMongoDBDataSource"); /** MongoDB data source item. */ class RVMongoDBDataSourceItem extends RVDataSourceItem_1.RVDataSourceItem { /** @hidden */ constructor(arg) { var _a; super(arg !== null && arg !== void 0 ? arg : new RVMongoDBDataSource_1.RVMongoDBDataSource()); this._collection = null; // @if SERVER_SDK this._customQuery = null; // @endif this._processDataOnServer = true; this._allowDiskUse = null; if (!(arg instanceof RVMongoDBDataSource_1.RVMongoDBDataSource)) { var props = arg.Properties; this._collection = props['Table']; // @if SERVER_SDK this.deserializeCustomQuerySupport(arg, false); // @endif this._processDataOnServer = props["ServerAggregation"] === true; this._allowDiskUse = (_a = props["AllowDiskUse"]) !== null && _a !== void 0 ? _a : null; } } /** @hidden */ toJson() { var json = super.toJson(); var props = json['Properties']; props['Table'] = this._collection; // @if SERVER_SDK this.serializeCustomQuerySupport(json, false); // @endif props['ServerAggregation'] = this._processDataOnServer; if (this._allowDiskUse !== null) { props['AllowDiskUse'] = this._allowDiskUse; } return json; } /** Collection name for accessing the documents */ get collection() { return this._collection; } set collection(value) { this._collection = value; } /** (Optional) Custom MongoDB query to use when getting data */ get customQuery() { return this._customQuery; } set customQuery(value) { this._customQuery = value; } /** Configures if the "Process Data on Server" option is turned on for this item, defaults to "true" */ get processDataOnServer() { return this._processDataOnServer; } set processDataOnServer(value) { this._processDataOnServer = value; } /** Controls whether MongoDB may use disk for aggregation operations. */ get allowDiskUse() { return this._allowDiskUse; } set allowDiskUse(value) { this._allowDiskUse = value; } /** @hidden */ getType() { return "RVMongoDBDataSourceItem"; } } exports.RVMongoDBDataSourceItem = RVMongoDBDataSourceItem;