update.js 874 B

12345678910111213141516171819202122232425
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.UpdateSearchIndexOperation = void 0;
  4. const operation_1 = require("../operation");
  5. /** @internal */
  6. class UpdateSearchIndexOperation extends operation_1.AbstractOperation {
  7. constructor(collection, name, definition) {
  8. super();
  9. this.collection = collection;
  10. this.name = name;
  11. this.definition = definition;
  12. }
  13. async execute(server, session) {
  14. const namespace = this.collection.fullNamespace;
  15. const command = {
  16. updateSearchIndex: namespace.collection,
  17. name: this.name,
  18. definition: this.definition
  19. };
  20. await server.commandAsync(namespace, command, { session });
  21. return;
  22. }
  23. }
  24. exports.UpdateSearchIndexOperation = UpdateSearchIndexOperation;
  25. //# sourceMappingURL=update.js.map