How to Grant MongoDB Roles to Multiple Users

In MongoDB, users are defined for specific databases. Each user is then assigned a list of roles that in turn define the user’s privileges. Not surprisingly, MongoDB’s API therefore makes it easy to assign a user a list of roles via the grantRolesToUser method: db.grantRolesToUser( "<username>", [ <roles> ], { <writeConcern> } ) However, MongoDB’s [...]

How to Prevent a MongoDB Connection Timeout

If you've connected to a hosted MongoDB instance, chances are you've experienced the odd connection timeout or drop. After a relatively short period of inactivity, you might try to run a query from within Studio 3T but are presented with a server error message box. If you try again, the query will work properly again. The [...]

How to Tell Your MongoDB Production and Test Databases Apart

Studio 3T has many advanced features, but it's the little things that also make it the best MongoDB GUI for Windows, Mac, and Linux. One of our users' favorite features is the ability to color-code collections and databases. It makes differentiating production data from test data easier and prevents accidents from mixing up the two. For example, you can [...]

How to Compare MongoDB Collections, Analyze Differences, and Sync Data

In this post, we'll show you how to compare MongoDB collections located in different databases and/or servers, analyze differences between their documents and fields, and sync your data using Studio 3T's Data Compare & Sync feature. The Importance of Comparing MongoDB Databases Choose Your Source and Target Connections Choose MongoDB Collections to Compare Configure Your [...]

3 Ways to View MongoDB Data

In this post, we'll show you three ways to view documents and collections in Studio 3T. Tree View Table View JSON View Download our MongoDB GUI and follow us step-by-step: Download Studio 3T Get Download Link for Later When you double-click on a connection in the Open Connections Tree, you’ll notice a [...]

How to Limit the Initial Number of Documents Loaded in a MongoDB Collection

By default, Studio 3T loads the first 50 documents of a collection (i.e. dbCursor.find({}).limit(50)) when first opening a collection view. As MongoDB documents can be up to 16MB in size, this can amount to serious traffic, so we've introduced a convenient way of limiting this initial number of documents either for all or specific collections. Limit [...]

How to Do MongoDB Aggregation Queries Easily

In this post, we're going to take a look at how to do MongoDB aggregation queries with the Aggregation Editor in Studio 3T (formerly MongoChef). We're going to build a query based on the freely available housing data from the City of Chicago Data Portal. Create the MongoDB Aggregation Query Identify the Question MongoDB Aggregation [...]