Skip to content

Commit 229bc77

Browse files
authored
docs: using or across embedded resources
1 parent 8a21a9c commit 229bc77

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

docs/references/api/resource_embedding.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,12 +846,14 @@ This sorts the list of actors in each film but does *not* change the order of th
846846
847847
Once again, this restricts the roles included to certain characters but does not filter the films in any way. Films without any of those characters would be included along with empty character lists.
848848
849-
An ``or`` filter can be used for a similar operation:
849+
An ``or`` filter can be used for a similar operation:
850850
851851
.. code-block:: bash
852852
853853
curl "http://localhost:3000/films?select=*,roles(*)&roles.or=(character.eq.Gummo,character.eq.Zeppo)"
854854
855+
However, this only works for columns inside ``roles``. See :ref:`how to use "or" across multiple resources <or_embed_rels>`.
856+
855857
Limit and offset operations are possible:
856858
857859
.. code-block:: bash
@@ -951,6 +953,18 @@ Both ``is.null`` and ``not.is.null`` can be included inside the `or` operator. F
951953
952954
curl "http://localhost:3000/films?select=title,actors(*),directors(*)&or=(actors.is.null,directors.is.null)"
953955
956+
.. _or_embed_rels:
957+
958+
OR filtering across Embedded Resources
959+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
960+
961+
You can also use ``not.is.null`` to make an ``or`` filter across multiple resources.
962+
For instance, to show the films whose actors **or** directors are named John:
963+
964+
.. code-block:: bash
965+
966+
curl "http://localhost:3000/films?select=title,actors(),directors()&directors.first_name=eq.John&actors.first_name=eq.John&or=(directors.not.is.null,actors.not.is.null)"
967+
954968
.. _empty_embed:
955969
956970
Empty Embed

0 commit comments

Comments
 (0)