MongoDb with Python

We will study, Interaction of Python with mongodb. You can run mongodb and Python program on Linux on which you are comfortable with. In "NoSQL Database" you have learned, how to install MongoDB. If not, please first learn how to install MongoDB. In order to install pymongo module you can take advantage of PIP program. Just download PIP program and run like "Python".
Use following command.
# pip install pymongo
After entering the command it would show the progress of installation.
Just to ensure, use the following syntax in Python shell. It all goes well it does not give any exception.
>>> import pymongo
Now we will explorer some python code for MongoDB one by one.
I assume that a MongoDB instance is running on your machine. In next page we will study how to insert JSON document to mongoDB through Python. I hope you are comfortable with JSON documents. If not read first Difference between JSON and XML and Python with JSON.