How to Query MongoDB Documents with Regex in Python

Introduction When you query a database, you’re not always looking for an exact string match. You might be querying a collection of store inventory for all items that have “Cookies” as some part of their name, or perhaps you’re searching for a person’s last name that begins with “Sch”, though you’re not sure exactly how … Continued

How To Delete MongoDB Documents Using Python

Introduction Delete MongoDB documents PyMongo is an important part of your regular maintenance routine for your MongoDB collections. As you add, modify, and analyze stored data, it becomes even more essential to clean out the clutter and remove MongoDB documents Python. The more organized your collections are, the easier it may become for you to … Continued

How to Update a MongoDB Document in Python

Introduction If you’re storing data in MongoDB, you’ll probably need to update documents from time to time. Fortunately, the PyMongo library makes it easy to get the job done with a simple Python script. Using PyMongo, your script can update a MongoDB document in a collection and have it return a results object containing the … Continued

How to Update Multiple MongoDB Documents in Python

Introduction If you use MongoDB to store and manage your data, there will be many times when you need to update multiple documents in a collection at once. In the past, the only method available to accomplish this was the update() method– you would need to use the multi flag with this method to change … Continued

How To Create an Index for a MongoDB Collection in Python

Introduction If you want to improve your query performance, it can be helpful to create indexes for your MongoDB collections. Indexes help make query requests more efficient because they store data in a way that makes it quick and easy to traverse. With the help of an index, MongoDB can locate documents that match your … 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.