diff --git a/api.rst b/api.rst index 0cb77ee17..d05788ce2 100644 --- a/api.rst +++ b/api.rst @@ -200,17 +200,20 @@ You can specify a path for a ``json`` or ``jsonb`` column using the arrow operat GET /people?select=id,json_data->>blood_type,json_data->phones HTTP/1.1 [ - { "id": 1, "blood_type": "A+", "phones": [{"country_code": "61", "number": "917-929-5745"}] }, + { "id": 1, "blood_type": "A-", "phones": [{"country_code": "61", "number": "917-929-5745"}] }, { "id": 2, "blood_type": "O+", "phones": [{"country_code": "43", "number": "512-446-4988"}, {"country_code": "43", "number": "213-891-5979"}] } ] +That also works with filters: + .. code-block:: http - GET /people?select=id,json_data->phones->0->>number HTTP/1.1 + GET /people?select=id,json_data->blood_type&json_data->>blood_type=eq.A- HTTP/1.1 [ - { "id": 1, "number": "917-929-5745"}, - { "id": 2, "number": "512-446-4988"} + { "id": 1, "blood_type": "A-" }, + { "id": 3, "blood_type": "A-" }, + { "id": 7, "blood_type": "A-" } ] .. _computed_cols: