This post will show you how to remove a database and collections from MongoDB.
Bring the database into use using the “Use databaseName” command to drop it. You can then delete the database using the db.dropDatabase() command.
Syntax to drop the database is:
> db.dropDatabase()
Example:
> use CompanyDB
switched to CompanyDB
> db.dropDatabase();
Syntax to drop the collection is:
> db.Collection.drop()
Example:
>db.emp.drop()
I hope you found this post to be informative.
Please join our mailing list to receive more interesting information.
Very great post. I just stumbled upon your blog and wished to mention that I
have truly enjoyed surfing around your blog posts.
In any case I will be subscribing on your rss feed and I’m hoping
you write again very soon!
LikeLike