18 Querying Atlas using SQL
This chapter covers
- Exploring the Atlas SQL interface architecture
- Enabling Atlas SQL interface with Quick Start
- Connecting to the Atlas SQL interface with
mongosh
- Querying with the
$sql
aggregation pipeline stage - Operating a short-form SQL syntax with
db.sql()
Atlas enables SQL querying through its Atlas Data Federation feature, allowing you to run SQL queries such as SELECT
and WHERE
statements directly on your MongoDB collections. This feature provides a unified interface for data analysis and reporting using familiar SQL syntax. This functionality also enables you to create visualizations, graphs, and reports on your Atlas data using relational business-intelligence (BI) tools such as Power BI and Tableau.
The Atlas SQL interface, along with its connectors and drivers, allows you to use your existing SQL skills to query and analyze live application data directly from your favorite SQL-based tools. Built with mongosql
, an SQL-92–compatible dialect, this interface is designed to eliminate complex extract, transform, load (ETL) operations, enabling faster insights on Atlas data while preserving the richness of the document model.