docs: Add example for ordering by json field
Resolves https://github.com/PostgREST/postgrest-docs/issues/364
This commit is contained in:
committed by
Wolfgang Walther
parent
e7dde2806c
commit
51db5ce26f
@@ -294,6 +294,21 @@ Note that ``->>`` is used to compare ``blood_type`` as ``text``. To compare with
|
|||||||
{ "id": 12, "age": 30 },
|
{ "id": 12, "age": 30 },
|
||||||
{ "id": 15, "age": 35 }
|
{ "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:
|
||||||
|
|
||||||
Composite / Array Columns
|
Composite / Array Columns
|
||||||
|
|||||||
Reference in New Issue
Block a user