MongoDB.live, free & fully virtual. June 9th - 10th. Register Now

MongoDB 4.2.3 trying to drop local database but failed

Hi,

For some simple testing, I am trying to drop the local database using the root role enabled user. but I am receiving an error, below I have shared logs.

command>:
1. use local
2. db.dropDatabase()

User:

{
	"_id" : "admin.manosh",
	"userId" : UUID("870d8587-17ac-48d4-b739-29cf56681551"),
	"user" : "manosh",
	"db" : "admin",
	"roles" : [
		{
			"role" : "root",
			"db" : "admin"
		}
	],
	"mechanisms" : [
		"SCRAM-SHA-1",
		"SCRAM-SHA-256"
	]
}

That is a system database. I don’t think you can drop it.

https://docs.mongodb.com/manual/reference/local-database/#the-local-database