Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Submitted
Categories Atlas
Created by Guest
Created on Oct 27, 2020

please offer a way to delete the content of a collection

I wish there were a way to allow a user to delete the contents of a collection within a database, that allows the collection to continue. Essentially I want an easy way to empty a collection to allow new data to be filled in its place.
  • Attach files
  • Guest
    Dec 10, 2020
    Hi Andrew, What about in old Mlab GUI "Delete all documents in collection" option? It is possible to truncate collection without dropping it? regards, Tomasz
  • Guest
    Oct 28, 2020
    Hi Cameron, One "odd" thing about a collection in MongoDB is that the collection doesn't really exist when there's no data in it. Out of curiosity, what's the overall challenge here; in other words why can't you just start inserting data back into the collection namespace and be on your way? I have a feeling the issue may boil own to the index configuration on that collection: if so that does make some sense. Appreciate any more color you can provide. Thanks -Andrew