Convert basic SQL SELECT queries into MongoDB find() calls — filters, sorting and limits.
Covers basic SELECT → find only: WHERE with AND, ORDER BY and LIMIT. It is not a full SQL translator — see limitations.
How to use this tool
A simple SELECT … FROM … query, optionally with WHERE, ORDER BY and LIMIT.
The MongoDB find() call appears in the output box, with the filter shown below it.
Confirm each WHERE condition became the filter operator you expect.
Copy the code or download it as a .js snippet for your app.
Formula & worked example
SELECT name, age FROM users WHERE age > 18 AND city = 'London' ORDER BY age DESC LIMIT 10 becomes db.users.find({"age": {"$gt": 18}, "city": "London"}, {"name": 1, "age": 1}).sort({"age": -1}).limit(10);
Limitations — read this before you rely on it
Limited scope, stated honestly: only single-table SELECT with WHERE conditions joined by AND, one ORDER BY field and LIMIT. NOT supported: JOINs, GROUP BY / aggregates, subqueries, OR, LIKE, DISTINCT, UPDATE/INSERT/DELETE and schema or type mapping — MongoDB documents have no fixed schema to map columns onto.
Frequently asked questions
No. Only single-table SELECT queries are supported. JOINs, GROUP BY, subqueries and OR are rejected with a plain message, not silently misconverted.
It is not supported. LIKE has no single equivalent operator here — use a $regex in MongoDB by hand for pattern matching.
It produces find(filter) with no projection, so all document fields are returned.
Numbers, quoted strings, true/false and null are parsed. Dates and ObjectIds have no SQL equivalent in this tool, so pass them as strings and convert by hand.
It is a read-only find() snippet, but always review it against your real collection and field names before running it on production data.
