Spaces:
Runtime error
Runtime error
File size: 1,000 Bytes
9756872 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateSearchIndexesOperation = void 0;
const operation_1 = require("../operation");
/** @internal */
class CreateSearchIndexesOperation extends operation_1.AbstractOperation {
constructor(collection, descriptions) {
super();
this.collection = collection;
this.descriptions = descriptions;
}
get commandName() {
return 'createSearchIndexes';
}
async execute(server, session) {
const namespace = this.collection.fullNamespace;
const command = {
createSearchIndexes: namespace.collection,
indexes: this.descriptions
};
const res = await server.command(namespace, command, { session });
const indexesCreated = res?.indexesCreated ?? [];
return indexesCreated.map(({ name }) => name);
}
}
exports.CreateSearchIndexesOperation = CreateSearchIndexesOperation;
//# sourceMappingURL=create.js.map |