First commit

This commit is contained in:
Aravind142857
2023-06-05 20:06:13 -05:00
commit 4e3c08d1c4
672 changed files with 179969 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
"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;
}
execute(server, session, callback) {
const namespace = this.collection.fullNamespace;
const command = {
createSearchIndexes: namespace.collection,
indexes: this.descriptions
};
server.command(namespace, command, { session }, (err, res) => {
if (err || !res) {
callback(err);
return;
}
const indexesCreated = res?.indexesCreated ?? [];
callback(undefined, indexesCreated.map(({ name }) => name));
});
}
}
exports.CreateSearchIndexesOperation = CreateSearchIndexesOperation;
//# sourceMappingURL=create.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/operations/search_indexes/create.ts"],"names":[],"mappings":";;;AAMA,4CAAiD;AAWjD,gBAAgB;AAChB,MAAa,4BAA6B,SAAQ,6BAA2B;IAC3E,YACmB,UAAsB,EACtB,YAAmD;QAEpE,KAAK,EAAE,CAAC;QAHS,eAAU,GAAV,UAAU,CAAY;QACtB,iBAAY,GAAZ,YAAY,CAAuC;IAGtE,CAAC;IAED,OAAO,CAAC,MAAc,EAAE,OAAkC,EAAE,QAA4B;QACtF,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;QAChD,MAAM,OAAO,GAAG;YACd,mBAAmB,EAAE,SAAS,CAAC,UAAU;YACzC,OAAO,EAAE,IAAI,CAAC,YAAY;SAC3B,CAAC;QAEF,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YAC3D,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE;gBACf,QAAQ,CAAC,GAAG,CAAC,CAAC;gBACd,OAAO;aACR;YAED,MAAM,cAAc,GAA4B,GAAG,EAAE,cAAc,IAAI,EAAE,CAAC;YAE1E,QAAQ,CACN,SAAS,EACT,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CACvC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA7BD,oEA6BC"}

View File

@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DropSearchIndexOperation = void 0;
const operation_1 = require("../operation");
/** @internal */
class DropSearchIndexOperation extends operation_1.AbstractOperation {
constructor(collection, name) {
super();
this.collection = collection;
this.name = name;
}
execute(server, session, callback) {
const namespace = this.collection.fullNamespace;
const command = {
dropSearchIndex: namespace.collection
};
if (typeof this.name === 'string') {
command.name = this.name;
}
server.command(namespace, command, { session }, err => {
if (err) {
callback(err);
return;
}
callback();
});
}
}
exports.DropSearchIndexOperation = DropSearchIndexOperation;
//# sourceMappingURL=drop.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"drop.js","sourceRoot":"","sources":["../../../src/operations/search_indexes/drop.ts"],"names":[],"mappings":";;;AAMA,4CAAiD;AAEjD,gBAAgB;AAChB,MAAa,wBAAyB,SAAQ,6BAAuB;IACnE,YAA6B,UAAsB,EAAmB,IAAY;QAChF,KAAK,EAAE,CAAC;QADmB,eAAU,GAAV,UAAU,CAAY;QAAmB,SAAI,GAAJ,IAAI,CAAQ;IAElF,CAAC;IAED,OAAO,CAAC,MAAc,EAAE,OAAkC,EAAE,QAAwB;QAClF,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;QAEhD,MAAM,OAAO,GAAa;YACxB,eAAe,EAAE,SAAS,CAAC,UAAU;SACtC,CAAC;QAEF,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE;YACjC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;SAC1B;QAED,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,GAAG,CAAC,EAAE;YACpD,IAAI,GAAG,EAAE;gBACP,QAAQ,CAAC,GAAG,CAAC,CAAC;gBACd,OAAO;aACR;YAED,QAAQ,EAAE,CAAC;QACb,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAzBD,4DAyBC"}

View File

@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UpdateSearchIndexOperation = void 0;
const operation_1 = require("../operation");
/** @internal */
class UpdateSearchIndexOperation extends operation_1.AbstractOperation {
constructor(collection, name, definition) {
super();
this.collection = collection;
this.name = name;
this.definition = definition;
}
execute(server, session, callback) {
const namespace = this.collection.fullNamespace;
const command = {
updateSearchIndex: namespace.collection,
name: this.name,
definition: this.definition
};
server.command(namespace, command, { session }, err => {
if (err) {
callback(err);
return;
}
callback();
});
}
}
exports.UpdateSearchIndexOperation = UpdateSearchIndexOperation;
//# sourceMappingURL=update.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/operations/search_indexes/update.ts"],"names":[],"mappings":";;;AAMA,4CAAiD;AAEjD,gBAAgB;AAChB,MAAa,0BAA2B,SAAQ,6BAAuB;IACrE,YACmB,UAAsB,EACtB,IAAY,EACZ,UAAoB;QAErC,KAAK,EAAE,CAAC;QAJS,eAAU,GAAV,UAAU,CAAY;QACtB,SAAI,GAAJ,IAAI,CAAQ;QACZ,eAAU,GAAV,UAAU,CAAU;IAGvC,CAAC;IAED,OAAO,CAAC,MAAc,EAAE,OAAkC,EAAE,QAAwB;QAClF,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;QAChD,MAAM,OAAO,GAAG;YACd,iBAAiB,EAAE,SAAS,CAAC,UAAU;YACvC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC;QAEF,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,GAAG,CAAC,EAAE;YACpD,IAAI,GAAG,EAAE;gBACP,QAAQ,CAAC,GAAG,CAAC,CAAC;gBACd,OAAO;aACR;YAED,QAAQ,EAAE,CAAC;QACb,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA1BD,gEA0BC"}