Skip to content
Advertisement

Tag: mongo-shell

In “mongosh”, how do I delete all databases without deleting the typical “admin”, “config”, or “local” databases?

What am I trying to do? I wrote a script called deleteDatabases.js and it’s supposed to delete all databases (besides “admin”, “config”, or “local”) when inside mongosh. I do not have access to mongo, only mongosh. What is the code that currently tries to do that? deleteDatabases.js Inside mongosh: Before what I did to successfully delete these databases was: What

Advertisement