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 characters
import pymongo | |
# Connect | |
# Through a MongoDB URI. The database should contain permissions for the user, if provided | |
client = pymongo.MongoClient('mongodb://user:password@host/database') | |
# Create database | |
db = client["database"] | |
# Create collection | |
coll = db["collection"] |