docs: using or across embedded resources

This commit is contained in:
Laurence Isla
2024-02-20 17:15:42 -05:00
committed by GitHub
parent 8a21a9c34e
commit 229bc77886
@@ -852,6 +852,8 @@ An ``or`` filter can be used for a similar operation:
curl "http://localhost:3000/films?select=*,roles(*)&roles.or=(character.eq.Gummo,character.eq.Zeppo)" 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: Limit and offset operations are possible:
.. code-block:: bash .. code-block:: bash
@@ -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)" 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:
Empty Embed Empty Embed