UNPKG

ravendb

Version:
42 lines 1.48 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GetCollectionStatisticsCommand = exports.GetCollectionStatisticsOperation = void 0; const RavenCommand_js_1 = require("../../Http/RavenCommand.js"); const ObjectUtil_js_1 = require("../../Utility/ObjectUtil.js"); class GetCollectionStatisticsOperation { getCommand(conventions) { return new GetCollectionStatisticsCommand(); } get resultType() { return "CommandResult"; } } exports.GetCollectionStatisticsOperation = GetCollectionStatisticsOperation; class GetCollectionStatisticsCommand extends RavenCommand_js_1.RavenCommand { constructor() { super(); } get isReadRequest() { return true; } createRequest(node) { const uri = node.url + "/databases/" + node.database + "/collections/stats"; return { uri }; } async setResponseAsync(bodyStream, fromCache) { if (!bodyStream) { this._throwInvalidResponse(); } let body = null; this.result = await this._defaultPipeline(_ => body = _) .collectBody() .objectKeysTransform({ defaultTransform: ObjectUtil_js_1.ObjectUtil.camel, ignorePaths: [/^collections\./i] }) .process(bodyStream); return body; } } exports.GetCollectionStatisticsCommand = GetCollectionStatisticsCommand; //# sourceMappingURL=GetCollectionStatisticsOperation.js.map