Created
December 16, 2013 16:30
-
-
Save axce1/7989908 to your computer and use it in GitHub Desktop.
Revisions
-
axce1 created this gist
Dec 16, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ from pymongo import Connection class MongoDB: def __init__(self, dbname): self.conn = Connection('localhost', 27017) self.db = self.conn[dbname] def createCollection(self, name=''): return self.db[name] if __name__ == '__main__': database = MongoDB("test") collection = database.createCollection('testCollection')