HI all, this document shows you how to remove all data from specific MongoDB collections.
MongoDB is NoSQL database, MongoDB uses JSON-like documents with optional schemas.
Sometimes there will be a requirement to delete all the data of specific MongoDB collection.
Here we will provide the steps for that.
Step 1: log in to mongo shell
Step 2: Now choose your database,
Step 3: now display your collections under scrapper database,
Step 4: Now delete all the data from user collection.
Success, now you deleted all the data from user collection. this will keep the collection in the MongoDB but it will delete all the data under the user collection.
© 2020, Techrunnr. All rights reserved.