Skip to content

Commit

Permalink
docs: using or across embedded resources
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenceisla authored Feb 20, 2024
1 parent 8a21a9c commit 229bc77
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion docs/references/api/resource_embedding.rst
Original file line number Diff line number Diff line change
Expand Up @@ -846,12 +846,14 @@ This sorts the list of actors in each film but does *not* change the order of th
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.
An ``or`` filter can be used for a similar operation:
An ``or`` filter can be used for a similar operation:
.. code-block:: bash
curl "http://localhost:3000/films?select=*,roles(*)&roles.or=(character.eq.Gummo,character.eq.Zeppo)"
However, this only works for columns inside ``roles``. See :ref:`how to use "or" across multiple resources <or_embed_rels>`.
Limit and offset operations are possible:
.. code-block:: bash
Expand Down Expand Up @@ -951,6 +953,18 @@ Both ``is.null`` and ``not.is.null`` can be included inside the `or` operator. F
curl "http://localhost:3000/films?select=title,actors(*),directors(*)&or=(actors.is.null,directors.is.null)"
.. _or_embed_rels:
OR filtering across Embedded Resources
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can also use ``not.is.null`` to make an ``or`` filter across multiple resources.
For instance, to show the films whose actors **or** directors are named John:
.. code-block:: bash
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)"
.. _empty_embed:
Empty Embed
Expand Down

0 comments on commit 229bc77

Please sign in to comment.