Mongodb connection in Python

from pymongo import Connection
connection = Connection(‘localhost’, 27017) 
db = connection.mydb
collection = db.mycollection
for doc in collection.find():
    doc

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.