Skip to content

Instantly share code, notes, and snippets.

@vgoklani
Created January 3, 2012 18:40
Show Gist options
  • Save vgoklani/1556251 to your computer and use it in GitHub Desktop.
Save vgoklani/1556251 to your computer and use it in GitHub Desktop.
drop a database or collection via pymongo
# dropping a database via pymongo
from pymongo import Connection
c = Connection()
c.drop_database('mydatabase')
# drop a collection via pymongo
from pymongo import Connection
c = Connection()
c['mydatabase'].drop_collection('mycollection')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment