@resolveio/server-lib 12.6.11 → 12.6.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { AggregateOptions, AggregationCursor, BulkWriteOptions, ChangeStream, ChangeStreamOptions,
|
|
2
|
+
import { AggregateOptions, AggregationCursor, BulkWriteOptions, ChangeStream, ChangeStreamOptions, CommandOperationOptions, CountDocumentsOptions, CreateCollectionOptions, CreateIndexesOptions, CursorStreamOptions, DeleteOptions, FindCursor, FindOneAndDeleteOptions, FindOneAndReplaceOptions, FindOneAndUpdateOptions, FindOptions, IndexDescription, IndexInformationOptions, InsertOneOptions, ListIndexesCursor, ListIndexesOptions, RenameOptions, ReplaceOptions, UpdateOptions, Collection, CollectionInfo, BulkWriteResult } from 'mongodb';
|
|
3
3
|
import { LookupTables } from '../models/report-builder.model';
|
|
4
4
|
import { UserModel } from '../models/user.model';
|
|
5
5
|
import { CollectionDocument, Document } from '../models/collection-document.model';
|
|
@@ -139,7 +139,7 @@ export declare class MongoManagerCollection<T extends CollectionDocument> {
|
|
|
139
139
|
distinct(key: string, filter?: MongoManagerFilter<T> & MongoManagerFilterOperators<T>, options?: CommandOperationOptions): Promise<T[]>;
|
|
140
140
|
drop(options?: CommandOperationOptions): Promise<boolean>;
|
|
141
141
|
dropIndex(indexName: string, options?: CommandOperationOptions): Promise<Document>;
|
|
142
|
-
dropIndexes(options?: CommandOperationOptions): Promise<
|
|
142
|
+
dropIndexes(options?: CommandOperationOptions): Promise<Boolean>;
|
|
143
143
|
find(filter?: MongoManagerFilter<T> & MongoManagerFilterOperators<T>, options?: FindOptions<T>, skipCache?: boolean): Promise<T[]>;
|
|
144
144
|
findById(id: string, options?: FindOptions<T>): Promise<T>;
|
|
145
145
|
findCount(filter?: MongoManagerFilter<T> & MongoManagerFilterOperators<T>, options?: FindOptions<T>): Promise<Number>;
|
|
@@ -156,7 +156,6 @@ export declare class MongoManagerCollection<T extends CollectionDocument> {
|
|
|
156
156
|
listIndexes(options?: ListIndexesOptions): ListIndexesCursor;
|
|
157
157
|
rename(newName: string, options?: RenameOptions): Promise<Collection<Document>>;
|
|
158
158
|
replaceOne(filter: MongoManagerFilter<T> & MongoManagerFilterOperators<T>, replacement: T, options?: ReplaceOptions, bypassLogs?: boolean, bypassCheckSchema?: boolean, doc?: T): Promise<number>;
|
|
159
|
-
stats(options?: CollStatsOptions): Promise<CollStats>;
|
|
160
159
|
updateMany(filter: MongoManagerFilter<T> & MongoManagerFilterOperators<T>, update: MongoManagerUpdateFilter<T>, options?: UpdateOptions, bypassLogs?: boolean, bypassCheckSchema?: boolean, bypassVersions?: boolean): Promise<number>;
|
|
161
160
|
updateOne(filter: MongoManagerFilter<T> & MongoManagerFilterOperators<T>, update: MongoManagerUpdateFilter<T>, options?: UpdateOptions, bypassLogs?: boolean, bypassCheckSchema?: boolean): Promise<number>;
|
|
162
161
|
watchCollection(pipeline?: any[], options?: ChangeStreamOptions): ChangeStream<T>;
|
|
@@ -683,7 +683,7 @@ var MongoManagerCollection = /** @class */ (function () {
|
|
|
683
683
|
var doc, versionDoc;
|
|
684
684
|
return __generator(this, function (_a) {
|
|
685
685
|
monitor_3.finish();
|
|
686
|
-
doc = returnVal
|
|
686
|
+
doc = returnVal;
|
|
687
687
|
if (doc) {
|
|
688
688
|
if (this.createLogs && !bypassLogs) {
|
|
689
689
|
log_collection_1.Logs.insertOne({
|
|
@@ -945,7 +945,7 @@ var MongoManagerCollection = /** @class */ (function () {
|
|
|
945
945
|
monitor = new monitor_manager_1.MonitorMongo('findOneAndDelete', this.collectionName, JSON.stringify([filter, options]));
|
|
946
946
|
index_1.ResolveIOServer.getMainDB().collection(this.collectionName, this.collectionOptions).findOneAndDelete(filter, options).then(function (res) {
|
|
947
947
|
monitor.finish();
|
|
948
|
-
var doc = res
|
|
948
|
+
var doc = res;
|
|
949
949
|
if (doc) {
|
|
950
950
|
if (_this.createLogs && !bypassLogs) {
|
|
951
951
|
log_collection_1.Logs.insertOne({
|
|
@@ -1018,7 +1018,7 @@ var MongoManagerCollection = /** @class */ (function () {
|
|
|
1018
1018
|
monitor = new monitor_manager_1.MonitorMongo('findOneAndReplace', this.collectionName, JSON.stringify([filter, replacement, options]));
|
|
1019
1019
|
index_1.ResolveIOServer.getMainDB().collection(this.collectionName, this.collectionOptions).findOneAndReplace(filter, replacement, options).then(function (res) {
|
|
1020
1020
|
monitor.finish();
|
|
1021
|
-
var doc = res
|
|
1021
|
+
var doc = res;
|
|
1022
1022
|
if (doc) {
|
|
1023
1023
|
if (_this.createLogs && !bypassLogs) {
|
|
1024
1024
|
log_collection_1.Logs.insertOne({
|
|
@@ -1108,7 +1108,7 @@ var MongoManagerCollection = /** @class */ (function () {
|
|
|
1108
1108
|
monitor = new monitor_manager_1.MonitorMongo('findOneAndUpdate', this.collectionName, JSON.stringify([filter, update, options]));
|
|
1109
1109
|
index_1.ResolveIOServer.getMainDB().collection(this.collectionName, this.collectionOptions).findOneAndUpdate(filter, update, options).then(function (res) {
|
|
1110
1110
|
monitor.finish();
|
|
1111
|
-
var doc = res
|
|
1111
|
+
var doc = res;
|
|
1112
1112
|
if (doc) {
|
|
1113
1113
|
if (_this.createLogs && !bypassLogs) {
|
|
1114
1114
|
log_collection_1.Logs.insertOne({
|
|
@@ -1528,7 +1528,7 @@ var MongoManagerCollection = /** @class */ (function () {
|
|
|
1528
1528
|
monitor_11 = new monitor_manager_1.MonitorMongo('findOneAndReplace', this.collectionName, JSON.stringify([filter, replacement, options]));
|
|
1529
1529
|
index_1.ResolveIOServer.getMainDB().collection(this.collectionName, this.collectionOptions).findOneAndReplace(filter, replacement, options).then(function (res) {
|
|
1530
1530
|
monitor_11.finish();
|
|
1531
|
-
var doc = res
|
|
1531
|
+
var doc = res;
|
|
1532
1532
|
if (doc) {
|
|
1533
1533
|
log_collection_1.Logs.insertOne({
|
|
1534
1534
|
_id: objectIdHexString(),
|
|
@@ -1558,7 +1558,7 @@ var MongoManagerCollection = /** @class */ (function () {
|
|
|
1558
1558
|
});
|
|
1559
1559
|
}
|
|
1560
1560
|
index_1.ResolveIOServer.getMongoManager().invalidateQueryCache(_this.collectionName);
|
|
1561
|
-
resolve(
|
|
1561
|
+
resolve(1);
|
|
1562
1562
|
}, function (err) {
|
|
1563
1563
|
monitor_11.finish();
|
|
1564
1564
|
console.log(new Date(), 'Error Find One And Replace', _this.collectionName, filter, replacement, options, err);
|
|
@@ -1588,20 +1588,6 @@ var MongoManagerCollection = /** @class */ (function () {
|
|
|
1588
1588
|
});
|
|
1589
1589
|
}); });
|
|
1590
1590
|
};
|
|
1591
|
-
MongoManagerCollection.prototype.stats = function (options) {
|
|
1592
|
-
var _this = this;
|
|
1593
|
-
return new Promise(function (resolve, reject) {
|
|
1594
|
-
var monitor = new monitor_manager_1.MonitorMongo('stats', _this.collectionName, JSON.stringify([options]));
|
|
1595
|
-
index_1.ResolveIOServer.getMainDB().collection(_this.collectionName, _this.collectionOptions).stats(options).then(function (res) {
|
|
1596
|
-
monitor.finish();
|
|
1597
|
-
resolve(res);
|
|
1598
|
-
}, function (err) {
|
|
1599
|
-
monitor.finish();
|
|
1600
|
-
console.log(new Date(), 'Error Stats', _this.collectionName, options, err);
|
|
1601
|
-
reject(err);
|
|
1602
|
-
});
|
|
1603
|
-
});
|
|
1604
|
-
};
|
|
1605
1591
|
MongoManagerCollection.prototype.updateMany = function (filter, update, options, bypassLogs, bypassCheckSchema, bypassVersions) {
|
|
1606
1592
|
var _this = this;
|
|
1607
1593
|
if (bypassLogs === void 0) { bypassLogs = false; }
|