ravendb
Version:
RavenDB client for Node.js
37 lines • 1.13 kB
JavaScript
import { RavenCommand } from "../../Http/RavenCommand.js";
import { ObjectUtil } from "../../Utility/ObjectUtil.js";
export class GetCollectionStatisticsOperation {
getCommand(conventions) {
return new GetCollectionStatisticsCommand();
}
get resultType() {
return "CommandResult";
}
}
export class GetCollectionStatisticsCommand extends 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.camel,
ignorePaths: [/^collections\./i]
})
.process(bodyStream);
return body;
}
}
//# sourceMappingURL=GetCollectionStatisticsOperation.js.map