update.js 1003 B

123456789101112131415161718192021222324252627282930
  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.AbstractCallbackOperation {
  7. constructor(collection, name, definition) {
  8. super();
  9. this.collection = collection;
  10. this.name = name;
  11. this.definition = definition;
  12. }
  13. executeCallback(server, session, callback) {
  14. const namespace = this.collection.fullNamespace;
  15. const command = {
  16. updateSearchIndex: namespace.collection,
  17. name: this.name,
  18. definition: this.definition
  19. };
  20. server.command(namespace, command, { session }, err => {
  21. if (err) {
  22. callback(err);
  23. return;
  24. }
  25. callback();
  26. });
  27. }
  28. }
  29. exports.UpdateSearchIndexOperation = UpdateSearchIndexOperation;
  30. //# sourceMappingURL=update.js.map