cgserver 10.0.19 → 10.0.20
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.
- package/README.md +2 -0
- package/dist/lib/Framework/Database/Mongo/MongoBaseService.js +4 -0
- package/dist/lib/Framework/Database/Mongo/MongoManager.js +8 -0
- package/dist/types/Framework/Database/Mongo/MongoBaseService.d.ts +1 -0
- package/dist/types/Framework/Database/Mongo/MongoManager.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -133,5 +133,9 @@ class MongoBaseService {
|
|
|
133
133
|
let rs = await this.mongoDb.distinct(this._table, key, where);
|
|
134
134
|
return rs;
|
|
135
135
|
}
|
|
136
|
+
async bulkWrite(operations, options) {
|
|
137
|
+
let bwr = await this.mongoDb.bulkWrite(this._table, operations, options);
|
|
138
|
+
return bwr;
|
|
139
|
+
}
|
|
136
140
|
}
|
|
137
141
|
exports.MongoBaseService = MongoBaseService;
|
|
@@ -534,6 +534,14 @@ class MongoExt {
|
|
|
534
534
|
}
|
|
535
535
|
return false;
|
|
536
536
|
}
|
|
537
|
+
async bulkWrite(collection, operations, options) {
|
|
538
|
+
if (!this._mongoDb) {
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
let bulk = this._mongoDb.collection(collection);
|
|
542
|
+
let bwr = bulk.bulkWrite(operations, options);
|
|
543
|
+
return bwr;
|
|
544
|
+
}
|
|
537
545
|
}
|
|
538
546
|
exports.MongoExt = MongoExt;
|
|
539
547
|
exports.gMongoMgr = new MongoManager();
|
|
@@ -199,5 +199,6 @@ export declare class MongoExt {
|
|
|
199
199
|
* @param cb
|
|
200
200
|
*/
|
|
201
201
|
quickTransaction(cb: Function, options?: mongo.TransactionOptions): Promise<false | any>;
|
|
202
|
+
bulkWrite(collection: string, operations: mongo.AnyBulkWriteOperation<mongo.BSON.Document>[], options?: mongo.BulkWriteOptions): Promise<mongo.BulkWriteResult>;
|
|
202
203
|
}
|
|
203
204
|
export declare let gMongoMgr: MongoManager;
|