In “mongo” using .mongorc.js it was possible to do this:
DB.prototype.dropDatabase = function() {
print('Dropping databases is not authorized')
}
But in “mongosh” using .mongoshrc.js it doesn’t have DB object, and db (lowercase) doesn’t seems to work the same way:
db.prototype.dropDatabase = function() {
print('Dropping databases is not authorized')
}
How could I override dropDatabase method in the new mongo shell?