Practical solutions

MongoDB Howtos How-To Guides

Solve the problem. Keep building. Collection of MongoDB how-to articles

Find the answer you need

Browse practical solutions, grouped by the task you're working on.

__COUNT__ entries on this page

How to Install MongoDB With HomebrewThis tutorial will tell you what is MongoDB and what are different ways to install it in your MAC. Moreover, installation with Homebrew will be explained in detail. How to Group Values by Multiple Fields Using MongoDBIn this article, we will look at the list of operators used along with aggregation and how you can implement them with the help of particular examples. How to Check Version of MongoDBThis tutorial will tell you what is MongoDB and how to check the exact version of MongoDB installed in your computer. Different methods to find out version of MongoDB are explained in detail. How to Check if a Field Exists in MongoDBThis tutorial will tell you what are fields in MongoDB and how to check whether it exists in the database or not. Moreover, it will tell you about embedded fields in the database and how to check their existence. How to Query Date With ISODate in MongoDBThis tutorial tackles what is Date() object and how you can sort collections using Date() method. Moreover, it will also explain how you can work date query with ISODate in MongoDB. How to Sorting a Collection by Date in MongoDBThis article will discuss how to sort collections and data in ascending or descending order using different types of sorting methods in MongoDB. How to Query With an OR Condition in MongoDBThe $or operator is used to perform logical OR operations on the array consisting of two or more expressions and select or retrieve only the documents that match at least one of the expressions given in the array. How to List All Databases in MongoDB ShellThe interactive Mongo Shell provides several options for obtaining data. This article demonstrates a couple of different approaches to listing databases in the Mongo Shell. How to Check Field Contains a String in MongoDBThis article will show you several examples, how to use regex in MongoDB to determine if a field contains a string or not, and to verify if a field contains a certain string. How to Drop or Delete a Collection in MongoDBThis tutorial article will tell you how to delete collections in MongoDB database and what are different methods to delete collections in MongoDB. How to Uninstall MongoDBTo completely remove MongoDB, you have to first remove the MongoDB services, the databases, and log files. Through this article, you will be able to uninstall MongoDB from Windows, Mac, and Linux. Make sure to keep a backup of your data, as the uninstallation cannot be reversed. How to Store Date and Time in MongoDBThis MongoDB tutorial explains what the Date() object is and how you can sort collections using the Date() method. This will also help you find the best methods to show and store date/time in MongoDB. How to Select Single or Multiple Fields for All Documents in a MongoDB CollectionIn this MongoDB tutorial article, you will learn how to select single or multiple fields for all documents given in a MongoDB collection by performing basic query operations through projection which specifies or restrict fields to return. How to Secure MongoDB With Username and PasswordIn this MongoDB article, you will learn how to properly configure the most important and fundamental security feature which is securing MongoDB with a username and password by creating an authentication user while remotely accessing MongoDB. How to Return Unique Values in MongoDBThis tutorial article will discuss the distinct function in MongoDB and how you can use it with db.collections. Moreover, you will learn how to return values from database with no duplicates in result. How to Rename a Database in MongoDBIn this MongoDB tutorial, you will learn how to rename a MongoDB database using different methods. These methods renames a MongoDB database using MongoDB GUI and rename a MongoDB database using MongoDB shell. How to Check if MongoDB Server Is RunningThis MongoDB instructional post will tell you how to check if MongoDB is installed and what is the version of installed MongoDB server. It is implemented in different operating systems like Windows, UBUNTU and MAC. How to Page in MongoDBThis instructional post will tell you what is paging in MongoDB. Why paging is needed in MongoDB and what are different methods or ways to get pagination done in MongoDB. How to List All Users in the Mongo ShellIn this MongoDB article, you will learn how to authenticate a user, how to list all users in the Mongo shell and how to use the db.getUser() and db.getUsers() methods. How to Export Collection Into a CSV Format in MongoDBThis instructional post discusses different ways to export collections to CSV format. We can use the Studio 3T and MongoExport. How to Export All Collections in MongoDBThis article will explain how you can export all collections in MongoDB. It will also throw light on how we can export all collections in MongoDB to CSV (Comma Separated Value) and JSON file types. How to Do Starts With Query in MongoDBIn this MongoDB article the user will learn how to do a starts with query using $regex. It provides regular expression capabilities for pattern matching strings in queries. How to Compare Date in MongoDBThis MongoDB tutorial tackles how to compare dates. How to Update Push Array in MongoDBThis MongoDB instructional post will tell you what are operators in MongoDB and how are they described. Moreover, $push operator is explained in detail to help in understanding the problem of updating array in MongoDB.