November 2017
Beginner to intermediate
204 pages
5h 23m
English
Python can connect to MongoDB using the pymongo module. To start off with, I will create a file called process_large_data.py and import the pymongo and csv modules. You will need to import both pymongo and MongoClient as I have done in the demonstration:
import csvimport pymongofrom pymongo import MongoClient
MongoClient takes care of establishing a connection and interfacing with the database system. The following steps in process_large_data.py will create an object assigned to the collection variable, which can be used to insert documents into the database:
....from pymongo import MongoClient## create a MongoClient object,## used to connect and interface## with mongodbclient = MongoClient()## these two ...
Read now
Unlock full access