docs: Add example for ordering by json field

Resolves https://github.com/PostgREST/postgrest-docs/issues/364
This commit is contained in:
Wolfgang Walther
2024-02-19 21:54:15 +01:00
committed by Wolfgang Walther
parent e7dde2806c
commit 51db5ce26f
+15
View File
@@ -294,6 +294,21 @@ Note that ``->>`` is used to compare ``blood_type`` as ``text``. To compare with
{ "id": 12, "age": 30 },
{ "id": 15, "age": 35 }
]
Ordering is also supported:
.. code-block:: bash
curl "http://localhost:3000/people?select=id,json_data->age&order=json_data->>age.desc"
.. code-block:: json
[
{ "id": 15, "age": 35 },
{ "id": 12, "age": 30 },
{ "id": 11, "age": 25 }
]
.. _composite_array_columns:
Composite / Array Columns