Last active
September 28, 2017 09:33
-
-
Save JinhaiZ/34f76499babd1682c65ec5d9b86cd771 to your computer and use it in GitHub Desktop.
Connect to local MongoDB using 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
import pymongo | |
connection = pymongo.MongoClient('localhost', 27017) | |
db = connection['db_name'] | |
collection = db['collection_name'] | |
# now we can do CRUD operations with this collection pointer | |
collection.find({}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment