Time for a new MongoDB GUI?

We'll match you for any remaining time on your current plan.
Let's talk
Radoslav Toth
June 29, 2022

MongoDB NodeShell

Mingo's NodeShell let's you execute JavaScript code to work with data directly in Mingo. 
This is NOT MONGO SHELL, though.

The command must be a regular async JS function with a return value.

This allows complex code with loops, conditions and variable initialization to be executed. This code must be a definition of a async function and should return something to see "results". You can use this to fetch and process data using JS code and return the result or update documents using a script with loop, etc. Examples:

async function run() {
  return await db.collection("").find({});
}
async function run() {
  const docs = await db.collection("Amenities").find({}).toArray();
  for (const doc of docs) {
    await db.collection("Amenities").updateOne({_id: doc._id}, {$set: {something: "new"}})
  }

  return docs.length;
}
async function run() {
  const oldSlug = await MingoPrompt('What was the old slug?')
  const newSlug = await MingoPrompt('What will be the new slug?')
  const confirmed = await MingoConfirm('You want to change ' + oldSlug + ' to ' + newSlug + '?');
  if (!confirmed) return false;

  const result = {
    'Locations': await db.collection("Locations").update({slug: oldSlug}, {
      "$set": { "oldSlug": oldSlug, "slug": newSlug }
    }),
    'Attractions': await db.collection("Attractions").updateMany({locationsCache: oldSlug}, {
      "$set": { "locationsCache.$": newSlug }
    }),
  }
  return result;
}

Variables available in the function's scope

You can use the following variables in your code:

  • db: the current MongoDB database connection
  • ObjectId: MongoDB wrapper for creating and manipulating ObjectIds
  • dayjs: for work with dates
  • _: lodash
  • MingoConfirm(message): Simple confirm modal shown with specified message. Returns true if user clicked on OK and false on Cancel.
  • MingoAlert(message): Simple alert modal shown with specified message. 
  • MingoPrompt(message): Simple prompt modal shown with specified message. Returns the value the user entered.

History

NodeShell keeps track of all previous functions executed so you can return to any of them later. Once you have a long list of history, you may search for any function using a fulltext search.

Snippets and saved code

Mingo provides some example snippets. You may also save your code for later use. Code is saved for each database separately.

Read more

New version released: 1.13.1

Here's a short list of bug fixes and improvements in our latest release. It is definitely not complete, there are many minor goodies we didn't even mention here. Enjoy! Bug Fixes Enhancements We would like to thank all the contributors for their valuable feedback and bug reports. Your contributions help us make Mingo better. Please […]
Radoslav Toth

MongoDB Atlas vs. self-hosted MongoDB quick guide.

It is plain as day that MongoDB has been a popular database solution for many applications in the recent past. One may argue this is due to its flexibility, scalability, and ease to use. However, Organizations are faced with opting for MongoDB Atlas, a fully managed cloud-based database service, or having MongoDB set up and […]
daviddurika

5 proven MongoDB performance optimization techniques

MongoDB is among the most popular NOSQL databases currently. It’s no secret that developers working on high-performance applications ally with MongoDB. It is a document-based database that is highly scalable and hence handles large amounts of data.  MongoDB can handle data ranging from small data sets to large and complex stacks of information. Whether working […]
daviddurika

We released v1.12.1. What's new?

We have just released a new version and I wanted to summarize what we added or changed. There is a long list of bug-fixes and minor improvements, but three points stand out most. Managing company licenses So far, there was no way to manage company licenses in Mingo. Now, if you have a company account […]
Radoslav Toth

Share MongoDB Configurations, Queries, Aggregation pipelines, NodeShell scripts, and more!

Are you tired of sending connection configurations which is a security risk? Or sending queries, pipelines, and scripts to your team members and then keeping the track of the latest version? Do you wish you could simply share your work with your team for faster and more efficient collaboration? Well, we have some great news […]
daviddurika

Tools for MongoDB

Are you tired of constantly struggling to create or update your MongoDB URIs? We know the feeling, and that's why we created the MongoDB URI Builder. This simple, yet powerful tool is designed to help you build or update your MongoDB URIs with ease. And the best part? It's completely free to use! With the […]
daviddurika

Mingo's security

At Mingo, we understand the importance of keeping your data safe and secure, which is why we've implemented two layers of security to ensure that your data is protected at all times. Two layers of security Everything that happens in Mingo, stays in Mingo. None of your data, connection information nor passwords are sent or […]
Radoslav Toth

MongoDB security for beginners

MongoDB security is based on role-based access control (RBAC). It enables users to control access to data based on their roles in the organization. With RBAC, users can be assigned to roles with specific privileges. Each role is granted access to certain resources, such as databases and collections. This ensures that only authorized users can […]
daviddurika

What is MongoDB?

MongoDB is quickly becoming one of the most popular databases in the world. It is a document-oriented database, which means it stores data in documents, rather than in tables like traditional databases. This makes it an ideal choice for applications that require flexibility and scalability. MongoDB is an ideal choice for applications that require fast […]
daviddurika

Compare and sync entire MongoDB databases 

Do you ever need to download the production DB to your localhost for development purposes? Or just sync changes from one DB to another? This can be done using Mingo’s Compare & Sync tool. You don’t need to write scripts or use the terminal mongodump / mongorestore functions, anymore. With Mingo’s Compare & Sync tool […]
Radoslav Toth

Download Mingo now

The best MongoDB GUI Admin. Intuitive • Fast • Secure
Download Now