Skip to main content

SQL Query to MongoDB Query

SQL QueryMongoDB Query
WHERE$match
GROUP BY$group
HAVING$match
SELECT$project
ORDER BY$sort
LIMIT$limit
SUM()$sum
COUNT()$sum
$sortByCount
join$lookup
SELECT INTO NEW_TABLE$out
MERGE INTO TABLE$merge (Available starting in MongoDB 4.2)
UNION ALL$unionWith (Available starting in MongoDB 4.4)