MongoDB Drop Collection example | Java @ Desk
Home » » MongoDB Drop Collection example

MongoDB Drop Collection example

MongoDB Drop Collection example

To drop a collection i.e. delete the complete collection as well as remove all the indexes use the below command

db.collection.drop()


This method do not take any argument. It also applies lock on the database and other operations will be in wait state until this gets finished.




0 comments:

Post a Comment