wingbot-mongodb 4.0.0 → 4.1.0
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/package.json +1 -1
- package/src/BaseStorage.js +19 -0
package/package.json
CHANGED
package/src/BaseStorage.js
CHANGED
|
@@ -480,6 +480,25 @@ class BaseStorage {
|
|
|
480
480
|
|
|
481
481
|
return h.digest('base64');
|
|
482
482
|
}
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Drop collection
|
|
486
|
+
*
|
|
487
|
+
* @returns {Promise}
|
|
488
|
+
*/
|
|
489
|
+
async drop () {
|
|
490
|
+
const db = typeof this._mongoDb === 'function'
|
|
491
|
+
? await this._mongoDb()
|
|
492
|
+
: this._mongoDb;
|
|
493
|
+
|
|
494
|
+
await db.dropCollection(this._collectionName)
|
|
495
|
+
.catch(() => {});
|
|
496
|
+
|
|
497
|
+
this._collection = null;
|
|
498
|
+
this._indexing = null;
|
|
499
|
+
this._shouldIndexBeforeRead = null;
|
|
500
|
+
this._shouldWaitForIndex = null;
|
|
501
|
+
}
|
|
483
502
|
}
|
|
484
503
|
|
|
485
504
|
module.exports = BaseStorage;
|