Skip to content

Instantly share code, notes, and snippets.

@joeclark-phd
Last active October 7, 2015 22:37
Show Gist options
  • Save joeclark-phd/7eed18f6dd04b8572974 to your computer and use it in GitHub Desktop.
Save joeclark-phd/7eed18f6dd04b8572974 to your computer and use it in GitHub Desktop.
PyMongo connection code
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