Skip to content

Instantly share code, notes, and snippets.

@riccardoscalco
Created April 27, 2015 09:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riccardoscalco/4adc9ed63bf4f8fb2082 to your computer and use it in GitHub Desktop.
Save riccardoscalco/4adc9ed63bf4f8fb2082 to your computer and use it in GitHub Desktop.
Drop Collection with Pymongo
import pymongo
from pymongo import MongoClient
# Removes a collection from the database.
# http://docs.mongodb.org/manual/reference/method/db.collection.drop/
client = MongoClient()
db = client.dbname
db.drop_collection('collectionName')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment