UNPKG

@ifit/mongoose-dao

Version:

Mongo helper methods for working with data in a DAO or repository pattern

14 lines 488 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.emptyMongoose = void 0; const mongoose = require("mongoose"); async function emptyMongoose() { if (!mongoose.connection) return; const collections = mongoose.connection.collections; await Promise.all(Object.values(collections).map((collection) => { return collection.deleteMany({}); })); } exports.emptyMongoose = emptyMongoose; //# sourceMappingURL=empty-mongoose.js.map