Blog
Field notes from the build.
What we learn building a local-first MongoDB GUI: query optimization, safe data maintenance, and the hard parts that don't fit in a table view.
LatestMongoDB natural language queries: generate filters and pipelines
A MongoDB natural language query should produce reviewable Query API syntax, not run model output against your database. Here is the safe workflow for filters, sorts, projections, and aggregations.
Read article
How to find slow queries in MongoDB with the profiler
MongoDB records slow operations in logs and, when profiling is enabled, in system.profile. Here is how to rank the expensive queries, read the evidence, and move the right one into explain().
Read article
MongoDB export with data masking: keep useful shape, remove PII
A safe MongoDB export preserves BSON types and analytical relationships without copying raw identifiers into the next environment. Here is when to redact, pseudonymize, exclude, and use canonical NDJSON.
Read article
MongoDB change stream monitor: debug inserts, updates, and deletes
A MongoDB change stream monitor shows what a collection is doing now: inserts, update deltas, replacements, and deletes. Here is how to use one without confusing a debugger with a durable event consumer.
Read article
Remove duplicates in MongoDB with an aggregation, step by step
The aggregation that finds duplicate documents in MongoDB is short: group on the identity key, keep the ids, match the groups with more than one. Removing them is the careful part. Here is the whole pattern, safely.
Read article
How to design a MongoDB schema for the queries you actually run
Good MongoDB schema design starts from your queries, not from normal forms. The real decision is embed versus reference, and it is answered by how you read the data. Here is the framework, with the trade-offs that bite later.
Read article
MongoDB performance optimization: a practical checklist
Most MongoDB performance work is the same handful of moves in the same order: find the slow queries, read the plan, fix the index, model the schema for your reads, reclaim the storage. Here is the checklist, with the deep dive behind each step.
Read article
How to enforce a schema in MongoDB with JSON Schema validation
MongoDB will reject writes that do not match a shape you define with $jsonSchema. Here is a real validator, how to add it without breaking existing data, and the one thing $jsonSchema does not do that everyone expects: set default values.
Read article
How to create an index in MongoDB (and when not to)
Creating an index in MongoDB is one line. Creating the right index is the actual skill. Here is the syntax, the field-order rule that makes compound indexes work, and how to confirm the index is doing its job.
Read article
How to create a geospatial index in MongoDB (and query by location)
A 2dsphere index lets MongoDB answer location questions: what is near me, what falls inside this area. Here is how to create one, store GeoJSON points, run a nearest query, and avoid the longitude-first trap that catches everyone.
Read article
MongoDB schema design for e-commerce, with a worked example
An e-commerce schema in MongoDB comes down to a few decisions: embed the cart, snapshot the order, reference the reviews. Here is a concrete products-cart-orders model and the one denormalization that saves you later.
Read article
How to speed up a slow MongoDB aggregation pipeline
A slow aggregation is usually a pipeline that scans everything before it filters. The fix is order: put the stages that can use an index first. Here is how to read an aggregation's explain plan and rearrange it.
Read article
Sparse and partial indexes in MongoDB: index fewer documents on purpose
Not every index needs to cover every document. Sparse and partial indexes index only some of them, which cuts size and write cost. Partial is the more powerful of the two. Here is when to use each.
Read article
MongoDB compound indexes: the field order that makes or breaks them
A compound index covers more than one field, and the order of those fields decides whether it works. The rule is Equality, Sort, Range. Get it right and one index replaces three, get it wrong and MongoDB ignores it.
Read article
MongoDB schema design patterns worth knowing (with examples)
Beyond embed-or-reference, a handful of named MongoDB schema patterns solve recurring problems: too many similar fields, unbounded growth, expensive recomputation. Here are the ones you will actually reach for.
Read article
How to use a TTL index in MongoDB to expire data automatically
A TTL index deletes documents once a date field ages past a limit you set, no cron job required. Here is how to create one, the two rules that decide whether it fires, and why yours might be quietly doing nothing.
Read article
How to add full-text search in MongoDB with a text index
A text index gives MongoDB keyword search: match words across fields, rank by relevance, weight the title over the body. Here is how to create one, query it with $text, and where its limits are.
Read article
How to drop an index in MongoDB (and how to know which ones to drop)
Dropping an index in MongoDB is one command. Knowing which index to drop is the part worth slowing down for. Measure the observation window, hide first, and keep restoration cheap.
Read article
How to create a unique index in MongoDB (and dedupe first)
A unique index stops MongoDB from ever storing two documents with the same value. The catch is you have to clear the existing duplicates before you can build it. Here is the syntax, the compound and partial variants, and the one that build error means.
Read article
How to version a MongoDB schema and migrate without downtime
MongoDB lets documents in one collection have different shapes, which is exactly what you need to change a schema without a big-bang migration. The trick is a version field and migrating lazily. Here is the pattern.
Read article
How to create a schema in MongoDB when there is no CREATE TABLE
MongoDB has no CREATE TABLE, so newcomers ask how you create a schema at all. The answer is three options: let it be implicit, enforce it with a validator, or define it in your app. Here is when to use each.
Read article
Why we built mongoui
Most MongoDB tools are row viewers. mongoui is built for the hard part — explaining slow queries, finding what's safe to clean, and never touching your data without showing you the blast radius first.
Read article