Skip to content

Multiple top-level filter conditions on the same embedded resource #3776

Discussion options

You must be logged in to vote
  1. How can I get only the films that have an actor with first_name Jehanne OR an actor with first_name John?

You have multiple options here, but all the same idea:

  • /films?select=title,actors!inner(first_name,last_name)&actors.first_name=in.Jehanne,John
  • /films?select=title,actors!inner(first_name,last_name)&or=(actors.first_name.eq.Jehanne,actors.first_name.eq.John)
  1. How can I get only the films that have an actor with first_name Jehanne AND an actor with first_name John?

You need multiple embeddings for that case. Same as in SQL, where you'd need multiple JOINs or EXISTS subqueries.

  • /films?select=title,jehanne:actors!inner(first_name,last_name),john:actors!inner(first_name,last_nam…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
4 replies
@SpiritQuaddicted
Comment options

@wolfgangwalther
Comment options

@wolfgangwalther
Comment options

@wolfgangwalther
Comment options

Answer selected by wolfgangwalther
Comment options

You must be logged in to vote
1 reply
@wolfgangwalther
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants