stats.js 943 B

123456789101112131415161718192021222324252627
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.DbStatsOperation = void 0;
  4. const responses_1 = require("../cmap/wire_protocol/responses");
  5. const command_1 = require("./command");
  6. const operation_1 = require("./operation");
  7. /** @internal */
  8. class DbStatsOperation extends command_1.CommandOperation {
  9. constructor(db, options) {
  10. super(db, options);
  11. this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse;
  12. this.options = options;
  13. }
  14. get commandName() {
  15. return 'dbStats';
  16. }
  17. buildCommandDocument(_connection) {
  18. const command = { dbStats: true };
  19. if (this.options.scale != null) {
  20. command.scale = this.options.scale;
  21. }
  22. return command;
  23. }
  24. }
  25. exports.DbStatsOperation = DbStatsOperation;
  26. (0, operation_1.defineAspects)(DbStatsOperation, [operation_1.Aspect.READ_OPERATION]);
  27. //# sourceMappingURL=stats.js.map