WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

MongoDB - Drop Collection



MongoDB - Drop Collection the way to drop a collection the use of MongoDB.

The drop() Method

MongoDB's db.Collection.Drop() is used to drop a group from the database.

Syntax

There are following Basic syntax of drop() command
db.COLLECTION_NAME.Drop()

Example

First, take a look at the to be had collections into your database mydb.
>use mydb
switched to db mydb
>show collections
mycol
mycollection
gadget.indexes
welookups
>
Now drop the collection with the name mycollection.
>db.mycollection.drop()
true
>
Again check the listing of collections into database.
>display collections
mycol
machine.indexes
welookups
>
drop() method will go back genuine, if the selected series is dropped successfully, in any other case it'll go back false.




Welookups is optimized for learning.Copy right 2018 - 2019 kumar aditya singh .
All Right Reserved and you agree to have read and accepted our term and condition.
All Rights Reserved.