Python MongoClient Examples

Introduction to MongoClient The class MongoClient enables you to make successful MongoDB server connections with your code. The MongoClient can accomplish this with client instances. When you use the PyMongo driver with the MongoClient, coding and connections happen more quickly. As a result, it becomes easier to make API calls to access your MongoDB databases … Continued

Get MongoDB Database And Collection Names with PyMongo and Python

Introduction MongoDB stores its data (known as “documents”) by grouping them in collections that are themselves stored in a database. This article will help you to create database and collection names for a MongoDB server, and then it will help you to retrieve the database and collection names, in Python, with some example code. Prerequisites … Continued

Build A MongoDB GUI App Using Kivy And Python (Part 2)

Introduction This article demonstrates how to build a GUI application for MongoDB, that can be deployed to multiple platforms, using the Kivy framework and Python programming language in less than 200 lines of code. The completed application in this article will allow the user to access the databases on a MongoDB localhost server, and retrieve … Continued

Build A MongoDB GUI App Using Kivy And Python (Part 1)

Introduction This article demonstrates how to build a GUI application for MongoDB, that can be deployed to multiple platforms, using the Kivy framework and Python programming language in less than 200 lines of code. This is Part 1 of a two-part series. This first article will show how to setup your app’s environment, and how … Continued

Check If A MongoDB Server Is Running Using The PyMongo Python Driver

Introduction When you work on a MongoDB database project, it’s important to verify that your port and domain are correct. Having the wrong settings and not realizing it right away can quickly lead to slowed productivity and increased frustration. This tutorial shows you how to check MongoDB server running PyMongo Python so that an exception … Continued

Use Python To Query MongoDB Documents In A Terminal Window

Introduction If you’re storing data in MongoDB, you may want to query for documents from a Python script. Fortunately, this is a simple task to accomplish. In this article, we’ll show you how to pass MongoDB query strings to a Python script from a terminal window. The script will then return a query response of … Continued

How to use Python to Check if an Index Exists for a MongoDB Collection

Introduction Indexing document fields in a MongoDB collection helps to facilitate search queries, making the searches run more efficiently. This tutorial will show how to determine if a MongoDB index exists with the Python driver. This tutorial will also touch on how to manage a MongoDB collection’s indexes in the Compass GUI. Prerequisites A good … Continued

How To Setup A MongoDB App Using The Flask Framework

Introduction This tutorial will explain how to use the Flask micro-framework to create a MongoDB restful API in Python using the flask_pymongo library. The Flask app for MongoDB serves as a lightweight wrapper for the PyMongo client driver needed for creating a python HTTP client for MongoDB. This Flask-PyMongo tutorial will provide examples for installing … Continued

How To Create and Setup a MongoDB Collection in Python

Introduction This tutorial will explain how to create a collection in MongoDB database using the Python PyMongo driver and provide examples of working with PYMongo collations, PYMongo collections and Python MongoDB collections. PYMongo collections are a group of documents saved in a MongoDB database, similar to a table in a SQL database. PyMongo is a … Continued

Keep in the know!

Subscribe to our emails and we’ll let you know what’s going on at ObjectRocket. We hate spam and make it easy to unsubscribe.