Last active
October 7, 2015 22:37
-
-
Save joeclark-phd/7eed18f6dd04b8572974 to your computer and use it in GitHub Desktop.
PyMongo connection code
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
from pymongo import MongoClient | |
# insert your connection details here | |
MONGO_URL = 'mongodb://<dbuser>:<pass>@<database URL>' | |
# connect to the MongoDB server | |
client = MongoClient(MONGO_URL) | |
# connect to the default database within the server | |
db = client.get_default_database() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment