Is it possible to remove collection or entire db using mongoose.js?
For those that are using the mochajs test framework and want to clean all db collections after each test, you can use the following which uses async/await:
afterEach(async function () {
const collections = await mongoose.connection.db.collections()
for (let collection of collections) {
await collection.remove()
}
})