How to delete system.profile collection from a MongoDB?

Firstly, turn off the profiling by setting its level to 0.

db.setProfilingLevel(0)

Then you can simply drop the collection.

db.system.profile.drop()

Now you are free to go and start it all over.


To riff off of the accepted answer, it is at times helpful to do in a single line:

db.setProfilingLevel(0); db.system.profile.drop(); db.setProfilingLevel(2);

I'm also finding that setting the size of system.profile to 10MB (or larger) rather than its default 1MB is quite helpful:

db.setProfilingLevel(0); db.system.profile.drop(); db.createCollection("system.profile", {capped: true, size: 10 * 1024 * 1024}); db.setProfilingLevel(2);