Professional Documents
Culture Documents
1. Objectives
a. Integrate MongoDB with your Python applications
Note: Although most of the instructions in this sheet are written for command line interpreter,
you are advised to save your python codes as scripts.
2. MongoDB
MongoDB stores data in JSON-like documents, which makes the database very flexible
and scalable.
To be able to experiment with the code examples, you will need access to a MongoDB
database.
You can download a free MongoDB database installer at https://www.mongodb.com
3. Pymongo
Python needs a MongoDB driver to access the MongoDB database.
4. Exercise
This exercise 8 from Lab 6. You have to do the same application using MongoDB to
store and retrieve the persons and their birthdays.
For this exercise, we will keep track of when our friend’s birthdays are, and be able to find
that information based on their name. Create a collection (in MongoDB) of persons (names
and birthdays). When you run your program it should ask the user to enter a name, and
return the birthday of that person back to them. The interaction should look something like
this: