Cron Calendar
Explain cron expressions and preview the next run times in any timezone.
OpenStack aggregation stages, check their order, and copy a ready-to-run aggregate() call.
Stack $match, $group, $lookup, and more visually.
See the aggregate array update as you edit.
Each stage explains what it does to the documents.
Copy a shell-ready snippet for your cluster.
You need revenue per country from an orders collection, joined to customers and sorted by total. That is six stages, and getting $lookup, $unwind and $group in the right order by trial and error against a live cluster is slow. This builder lets you lay the stages out and sanity-check them before you touch the database.
Ten stage types are available: $match, $group, $sort, $limit, $skip, $project, $lookup, $unwind, $addFields and $count. Each stage gets its own editor, and you can move it up or down, duplicate it or remove it. Set the collection name, optionally add allowDiskUse, and the output is a mongosh snippet in the form db.orders.aggregate([...]). You can also copy just the pipeline array as JSON. With Explain on, every stage is narrated in plain English, a quick way to confirm that a $group key or $lookup field is what you intended.
Stage bodies are parsed as strict JSON, so keys need double quotes and shell helpers like ISODate() are not accepted; add those after pasting into mongosh. The review panel warns when the pipeline does not start with $match, when $match runs after $group or $lookup, when $limit comes before $sort, and when a $sort after $group has no limit. The builder produces aggregate() calls only, not find() queries. For relational databases, use the visual SQL SELECT builder, and the JSON validator helps pin down a stage body that will not parse.
Nothing connects to MongoDB. The pipeline is assembled as text in your browser, so collection names and filter values stay local.
Keyboard shortcut
Answers for this tool. For site-wide help, open the FAQ hub.
Only a leading $match (or $geoNear) can use an index, and filtering early shrinks the number of documents every later stage processes. A $match placed after $lookup means the join runs for documents you then throw away.
When a blocking stage such as $sort or $group needs more than the 100 MB in-memory limit. It stops the query from failing, but an index or an earlier $match is usually the better fix.
Not as one block. Add the stages you need and paste each stage body into its own editor. Keeping one stage per editor is what lets the tool explain and order-check them individually.