Apr 072011
Drop a collection in MongoDB
Answer:
To drop a collection in MongoDB, enter the interactive shell, and type:
db.foo.drop()
If you want to remove all the objects only, not dropping the collection, try
db.foo.remove()
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Drop a collection in MongoDB
Answer:
To drop a collection in MongoDB, enter the interactive shell, and type:
db.foo.drop()
If you want to remove all the objects only, not dropping the collection, try
db.foo.remove()