I need to write a nightly cron job (using Lambda + Node.js) that will drop all collections in Database B, then use db.copyDatabase to copy Database A to Database B. I know how to do all these operations manually via the mongo client, but not sure how to do it in JavaScript.
Ideally it would be good to use https://mongodb.github.io/node-mongodb-native/ to do so, though I don't see a way to invoke raw commands such as db.copyDatabase.