Drop Collection in MongoDB




Syntax:
Db.collection-Name.drop();

Example:

>use mydb
switched to db mydb
>show collections
mycol
mycollection

Now drop collection by name,
>db.mycollection.drop()
true

Again check the list

>show collections
mycol

See the above result, mycollection is missing...

No comments:

Post a Comment

Please do not enter any spam link in the comment box.

NUnit : Introduction

There are several unit test tools in the market, but one of them is NUnit, the most popular tool for doing unit testing. So in this tutorial...