UnQTools
Developer Runs in your browser

MongoDB Query Builder

Build MongoDB queries visually with AND/OR/NOR grouping, $eq/$ne/$gt/$gte/$lt/$lte/$in/$nin/$regex/$exists/$type/$size/$mod/$not operators, projection, sort, limit, skip, and operation modes (find / findOne / insertOne / updateMany / updateOne / replaceOne / deleteMany / deleteOne). Generates MQL JSON, mongosh, and driver code for Node, Python, Java, C#, and PHP. Runs an in-browser MQL filter engine against pasted sample documents. 100% client-side.

100% Private Works Offline Instant

About MongoDB Query Builder

Build MongoDB queries visually with AND/OR/NOR grouping, $eq/$ne/$gt/$gte/$lt/$lte/$in/$nin/$regex/$exists/$type/$size/$mod/$not operators, projection, sort, limit, skip, and operation modes (find / findOne / insertOne / updateMany / updateOne / replaceOne / deleteMany / deleteOne). Generates MQL JSON, mongosh, and driver code for Node, Python, Java, C#, and PHP. Runs an in-browser MQL filter engine against pasted sample documents. 100% client-side. Everything runs locally in your browser — your data never leaves your device.

How to use

  1. Enter your input in the tool above.
  2. Adjust any options to your preference.
  3. Use the Copy or Download buttons to save the result.
  4. Everything happens locally — your data never leaves your browser.

FAQ

Which MongoDB operators does this builder support?

All common comparison operators ($eq, $ne, $gt, $gte, $lt, $lte), array operators ($in, $nin, $all via $in), $regex, $exists, $type, $size, $mod, $not, plus $and / $or / $nor logical grouping with unlimited nesting. Each condition is type-aware — strings, numbers, booleans, null, ObjectId (24-hex), and ISODate are emitted as proper Extended JSON ($oid / $date) and mongosh literals (ObjectId(...) / ISODate(...)).

What does the tool export?

Six formats: (1) clean MQL JSON (filter + projection + sort + limit + skip); (2) mongosh one-liner; (3) Node.js driver code with MongoClient; (4) Python (PyMongo) with sort/limit/skip chained; (5) Java driver code using Document.parse; (6) C# .NET with BsonDocument.Parse; (7) PHP driver code. All of find, findOne, insertOne, updateMany/One, replaceOne, deleteMany/One are covered.

Can I test my query against sample documents?

Yes. Paste an array of JSON documents into the sample-documents panel and the in-browser MQL filter engine runs your filter against them in real time. The engine supports dot-notation field access (including array-of-objects), $and/$or/$nor, and all the comparison operators. Matched documents are highlighted; counts and per-doc errors are shown.

Are my queries or sample documents uploaded anywhere?

No. This is a 100% client-side tool — your queries, sample documents, and history never leave the browser. History (last 20 builds) is stored in localStorage on this device only, and the shareable-URL encodes the full query state in the URL fragment (after #), which browsers never send to servers.

What extra features does this tool have versus others?

(1) 14 query operators + 3 logical groupings with unlimited nesting. (2) 8 operation modes (find / findOne / insertOne / updateMany / updateOne / replaceOne / deleteMany / deleteOne). (3) 6 driver code exports. (4) Type-aware values (string / number / boolean / null / ObjectId / ISODate) with Extended JSON + mongosh literals. (5) Projection (include/exclude). (6) Multi-field sort. (7) Limit + skip. (8) In-browser MQL filter engine on pasted sample docs. (9) Dot-notation field access. (10) Field autocomplete extracted from sample docs. (11) Field-name validation. (12) JSON doc validation for inserts/updates. (13) localStorage history (max 20). (14) Shareable URL with full state. (15) Update-operator doc editor ($set, $unset, $inc, $push, $pull).

Search tools and actions

Search across all 616 tools, categories, and quick actions.