Is it possible to remove collection or entire db using mongoose.js?
If want to drop collection after tests and your test were running in a docker container:
mongoose = require("mongoose");
...
afterAll(async () => {
const url = 'mongodb://host.docker.internal:27017/my-base-name';
await mongoose.connect(url)
await mongoose.connection.collection('collection-name').drop()
})