SQL to Mongo

MongoQUI University

SQL Editor

The SQL Editor is the main interface for writing SQL queries that will be executed against MongoDB collections.

Key Features:

  • Write SQL queries to fetch, update, insert, or delete data in MongoDB.
  • Execute queries using Cmd/Ctrl + Enter or the execute button.

Supported Operations:

  • SELECT: Basic queries, select all or specific columns, table aliases, comments.
  • INSERT INTO: Insert single rows with named columns.
  • UPDATE: Update single or multiple fields with a WHERE clause.
  • DELETE FROM: Delete documents using WHERE clause (bulk deletes without conditions are not allowed).

Translate

Detailed Feature List:

  • WHERE Clause Operators: =, !=, <>, >, <, >=, <=, IS NULL, IS NOT NULL, LIKE, ILIKE, IN, BETWEEN, AND, OR, NOT, parentheses for complex conditions.
  • Sorting and Pagination: ORDER BY, LIMIT, OFFSET, pagination parameters.
  • Aggregate Functions: COUNT, SUM, AVG, MIN, MAX (with or without GROUP BY).
  • GROUP BY & HAVING: Support for single/multi-column grouping, HAVING conditions, date functions in grouping.
  • Date Functions: DATE, YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, etc.
  • JOINs: INNER JOIN, LEFT/RIGHT/FULL OUTER JOIN (converted as needed), table aliases, multi-joins, wildcard projections.
  • DISTINCT: Remove duplicates for single or multiple columns.
  • Type Support: Strings, numbers, booleans, nulls, dates (auto-converted).
  • Insert & Update: Automatic type conversion.
  • DELETE: WHERE clause required for safety.

Current Limitations:

  • No subqueries, CTEs, UNION/INTERSECT/EXCEPT, window functions, stored procedures, or transactions.
  • JOINs support equality only; complex JOINs use the first condition only.
  • No CASE/WHEN, COALESCE, or DISTINCT inside aggregates.
  • Reserved SQL keywords as field names may cause warnings.