Created
January 3, 2012 18:40
-
-
Save vgoklani/1556251 to your computer and use it in GitHub Desktop.
drop a database or collection via pymongo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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