Given a Json Object in the form of Map<String, Object>, and given a query to match a key by path (similar to jq), extract its value. Asked in the phone screen stage. For example, the path .contacts.cell returns the nested cell value, while a missing path returns null. Reported follow-up: extend the functionality to support any key (*) match.
Write a PostgreSQL query using the stored JSONB object and requested path.
request_id, path_query, and extracted value.request_id ascending.| Column | Type | Description |
|---|---|---|
| object_idPK | INT | Identifier of the stored JSON object |
| payload | JSONB | JSON document to query |
| Column | Type | Description |
|---|---|---|
| request_idPK | INT | Identifier of the path lookup request |
| object_id | INT | JSON object requested for lookup |
| path_query | VARCHAR(255) | jq-style path beginning with a dot |