At uSwitch, I often work with multiple MongoDB databases as part of the same system. Recently I spent a lot of time in the Mongo shell jumping between the two databases to reset data to its initial state.
This requires several commands
use otherdb; db.collectionx.remove(); use originaldb; db.collectiony.remove();
Plus I often forget which database I’m in.
Happily you can use the db.getSiblingDB method to access another database without having to switch databases. This shorten it down to a single command: