SQL to MongoDB Query Converter
Translate SQL into MongoDB queries — SELECT with WHERE (AND/OR, IN, LIKE, BETWEEN, IS NULL), ORDER BY, LIMIT, GROUP BY aggregations, plus INSERT, UPDATE and DELETE.
How to use
- 1Paste a SQL statement.
- 2Copy the equivalent MongoDB shell query.
How it's calculated
WHERE clauses become filter documents ($gt, $in, $regex for LIKE, $or/$and), columns become projections, ORDER BY → sort, LIMIT/OFFSET → limit/skip, and GROUP BY with COUNT/SUM/AVG/MIN/MAX becomes an aggregation pipeline.
Frequently asked questions
Does it support JOINs?
Not yet — JOINs map to $lookup stages, which depend on how your documents are modeled. Single-table queries are supported.
How is LIKE translated?
To a case-insensitive $regex: '%son' becomes 'son$', 'a_c%' becomes '^a.c'.
Can I use it for mongosh and drivers?
The output is mongosh syntax; drivers accept the same filter and pipeline documents.