
VisuaLeafOpening a MongoDB collection is quite easy. But understanding the data inside is the hard part. A...
Opening a MongoDB collection is quite easy.
But understanding the data inside is the hard part.
A few JSON objects may be easy to handle, but as the data grows and the number of objects increases, it becomes really hard to visualize what is going on.
That’s where most people are stuck.
Not because MongoDB is complicated, but because they haven’t learned how to explore the data yet.
In this guide, we are going to walk you through a series of steps and focus on the most important things you need to know about MongoDB, like:
We’ll use a simple payments collection:
{
amount: 129,
courseId: ObjectId("69af3833c12d7f138927952e"),
currency: "USD",
method: "Credit Card",
status: "completed",
paidAt: ISODate("2026-02-28T14:10:10Z")
}
Before you start typing your queries, take a second and ask yourself:
“Do I actually understand what’s inside this collection?”
If you answer no, then you’re essentially guessing every time you write a query.
Let’s take a look at the data instead of going straight into code.
The first thing we should do is take a look around and see what the data actually looks like.
Use the tree view to:
It’s like clicking through folders to see what’s inside.
You don’t have to understand everything right now, just get a feel for the data
MongoDB tree view showing documents and data types
Once you understand the structure, switch to a table view.
This makes it much easier to compare documents and spot patterns.
When you're using a tool like VisuaLeaf, you can switch between these views easily.
Now, each row is a document, and each column is a field.
For instance:
Here’s a simple way to think about it:
MongoDB table view showing documents as rows and fields as columns
You already know the structure of your data, as well as the way documents compare to each other.
You can finally start working with your data.
You might want to:
Here, the data editor can help you.
You are no longer simply looking at your data, you are working with it.
If you can search and edit your data, everything makes sense.
MongoDB table view showing how to search and edit values in documents
Once you are comfortable working with your data, the next step is to focus on specific results.
For example, you might want to see only completed payments in USD.
Instead of writing code, you can use a visual query builder.
You simply:
In tools like VisuaLeaf, you can even build queries using drag-and-drop, without writing any code.
Example:
{
currency: "USD",
status: "completed"
}
Build and refine your queries visually, and see results update instantly.
When you’re confident with exploring and filtering your data, you’re ready to begin writing queries yourself.
For example, let’s say you want to see only payments in USD, sorted by the newest ones first.
db.payments.find(
{ currency: "USD" },
{ amount: 1, currency: 1, status: 1, paidAt: 1 }
).sort({ paidAt: -1 }).limit(10)
SELECT amount, currency, status, paidAt
FROM payments
WHERE currency = 'USD'
AND status = 'completed'
ORDER BY paidAt DESC
LIMIT 10
Both queries return the same result, just using different approaches.
MongoDB works with documents and step-by-step operations, while SQL describes the result in a more structured way.
The key point is this:
It’s not about the syntax -> it’s about understanding your data.
You don’t start with queries.
You get there after exploring and filtering your data first.
Here’s the workflow you should follow whenever you open a new MongoDB collection:
Each step is building on the last one. Everything is easier than it was before.
While working with this dataset, we encountered an interesting fact:
Some documents were missing values.
For example, if the method field is not filled in, then such a payment might not be included in a filter.
{ method: "Credit Card" }
This query will only retrieve documents where there is a method and where method is equal to "Credit Card".
If a payment does not have a method, it will not be returned at all, even though it does exist.
This is why it is important to have consistent data before you start to query it.
With MongoDB, you get a lot of flexibility.
The hardest part is to understand your data.
The good part is, you don't have to dive into complex queries right away.
By:
You can understand your data much faster.
If you want to explore your data this way, you can try it directly in VisuaLeaf.