end_sessions.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.EndSessionsOperation = void 0;
  4. const responses_1 = require("../cmap/wire_protocol/responses");
  5. const command_1 = require("../operations/command");
  6. const read_preference_1 = require("../read_preference");
  7. const utils_1 = require("../utils");
  8. const operation_1 = require("./operation");
  9. class EndSessionsOperation extends command_1.CommandOperation {
  10. constructor(sessions) {
  11. super();
  12. this.writeConcern = { w: 0 };
  13. this.ns = utils_1.MongoDBNamespace.fromString('admin.$cmd');
  14. this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse;
  15. this.sessions = sessions;
  16. }
  17. buildCommandDocument(_connection, _session) {
  18. return {
  19. endSessions: this.sessions
  20. };
  21. }
  22. buildOptions(timeoutContext) {
  23. return {
  24. timeoutContext,
  25. readPreference: read_preference_1.ReadPreference.primaryPreferred
  26. };
  27. }
  28. get commandName() {
  29. return 'endSessions';
  30. }
  31. }
  32. exports.EndSessionsOperation = EndSessionsOperation;
  33. (0, operation_1.defineAspects)(EndSessionsOperation, operation_1.Aspect.WRITE_OPERATION);
  34. //# sourceMappingURL=end_sessions.js.map