update.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.UpdateSearchIndexOperation = void 0;
  4. const responses_1 = require("../../cmap/wire_protocol/responses");
  5. const operation_1 = require("../operation");
  6. /** @internal */
  7. class UpdateSearchIndexOperation extends operation_1.AbstractOperation {
  8. constructor(collection, name, definition) {
  9. super();
  10. this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse;
  11. this.collection = collection;
  12. this.name = name;
  13. this.definition = definition;
  14. this.ns = collection.fullNamespace;
  15. }
  16. get commandName() {
  17. return 'updateSearchIndex';
  18. }
  19. buildCommand(_connection, _session) {
  20. const namespace = this.collection.fullNamespace;
  21. return {
  22. updateSearchIndex: namespace.collection,
  23. name: this.name,
  24. definition: this.definition
  25. };
  26. }
  27. handleOk(_response) {
  28. // no response.
  29. }
  30. buildOptions(timeoutContext) {
  31. return { session: this.session, timeoutContext };
  32. }
  33. }
  34. exports.UpdateSearchIndexOperation = UpdateSearchIndexOperation;
  35. //# sourceMappingURL=update.js.map