Skip to content
Run here 100% in your browser, no upload, no login

SQL to MongoDB

Turn SELECT statements into MongoDB find() queries, in your browser.

How to use it

  1. Paste a SELECT statement into the left panel.
  2. The converter reads the SELECT list, FROM, WHERE, ORDER BY, LIMIT and OFFSET clauses.
  3. The right panel shows the equivalent MongoDB shell call: db.collection.find(filter[, projection]).sort().skip().limit().
  4. Read the notes line under the panels — it records every adjustment, such as LIKE becoming an anchored regex.
  5. Copy the query into mongosh, Compass or your driver code.

Common use cases

Why it stays private

The whole conversion runs in your browser's memory. Query text often contains table names, field names and sample data from production, and none of it is uploaded.

FAQ

Q: What happens with JOIN, GROUP BY or HAVING? A: The converter stops with an error that names the clause and the reason: find() cannot join or group. Those operations live in the aggregation pipeline ($lookup, $group, $match), and the error message says so instead of producing a query that would silently return the wrong thing.

Q: How is LIKE translated? A: Into an anchored $regex: % becomes .*, _ becomes ., and every other character is escaped. Because SQL LIKE is case-insensitive on some engines but MongoDB regex is case-sensitive by default, add the i option in mongosh when your collation depends on it.

Q: Does it handle AND and OR precedence? A: Yes. AND binds tighter than OR, and parentheses are respected, so the filter tree matches the SQL grouping. The output uses explicit $and and $or arrays wherever more than one condition applies, which keeps the structure visible.

Your data stays on this device

SQL to MongoDB runs 100% locally. Everything you paste or drop is processed by your own browser and never transmitted. Nothing is stored on our servers — close the tab and it is gone.

Nothing you type is sent to a server, logged, or used for analytics. The page works even with your network disconnected after first load.