1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to NoSQL

Connected

Exercise

Querying nested documents with Postgres JSON

With Postgres JSON, querying semi-structured data is a breeze! Postgres provides built-in operators, such as ->. In this example, you'll practice using this operator to query reviews data from a column of type JSON. This table takes the form below:

nested_reviews table, showing sample data.

pandas has been imported as pd, and a sqlalchemy connection object has been configured, and made available for you via the db_engine variable. Best of luck!

Instructions 1/2

undefined XP
    1
    2
  • Use the -> operator to query the statement field from the nested_reviews table.