from pymongo import *client = MongoClient(host='localhost', port=27017)db = client.test # connect to database 'test'# db = client['primer'] # the same as row before