Select Data with Queries

    March 16, 2025
    + 12

    These guides explain how to read data with a SQL++ query. The SQL++ query language enables you to retrieve a document by inspecting its contents to see if it matches a certain criterion. Key-value operations are quicker, but querying documents allows for richer search capabilities — for example, "Give me all likes and followed users located in the US", versus "Give me a user with the ID e3d882a4".

    Read Data and Return Results

    To read data from a data source using SQL++, you must use a selection query; that is, a query using the SELECT statement.

    Query Across Relationships

    You can use a join to read objects from one data source, combine them with corresponding objects from another data source, and return the joined objects.

    Nest and Unnest Documents

    SQL++ provides syntax which enables you to nest (create) or unnest (flatten) arrays of embedded documents in a query.

    Grouping and Aggregation

    You can use aggregate functions to perform calculations over multiple values. Grouping enables you to display the results in groups.

    Prepared Statements

    If you need to execute certain SQL++ statements repeatedly, you can use placeholder parameters and prepared statements to optimize query reuse.