Tuesday, February 21, 2023

Insertion Function

insert_one function can be used to insert one document at a time in MongoDB. We will first create a dictionary and then insert it into the MongoDB database:post = {"_id": 'qwertyui123456',        'username': 'someone',         'name':'Gyan',         'address':'Somewhere in India'}        post_id = table.insert_one(post).inserted_idpost_idOutput: qwertyui123456 MongoDB...
Share:

Friday, February 17, 2023

Retrieving / Fetching the Data

We can query MongoDB using a dictionary-like notation or the dot operator in PyMongo. In the previous section, we used the dot operator to access the MongoDB database. Here, we will also see a demonstration of a dictionary-like syntax.First, let’s fetch a single document from the MongoDB collection....
Share:

Tuesday, February 14, 2023

PyMongo and MongoDB

PyMongo is a Python library that enables us to connect with MongoDB. It allows us to perform basic operations on the MongoDB database.So, why Python? It’s a valid question.We have chosen Python to interact with MongoDB because it is one of the most commonly used and considerably powerful languages for...
Share:

Saturday, February 11, 2023

Understanding the Problem Statement

Let’s understand the problem we’ll be solving in future. This will give you a good idea of the kind of projects you can pick up to further hone your MongoDB in Python skills.Suppose you are working for a banking system that provides an application to the customers. This app sends data to your MongoDB database. This data is stored in three collections:The accounts collection contains information...
Share: