Imagine you have a "movie" content type that has a multi-value entity reference field for the "actor" content type.
Let's say you have movies with Keanu Reeves. Let's say you have movies with Sandra Bullock. Let's also say you have a movie that has both Keanu and Sandra.
Using JSON:API, I can get a list of all movies that have Keanu:
/jsonapi/node/movie?include=field_actors,field_genre,field_poster&filter[actor][condition][path]=field_actors.title&filter[actor][condition][value]=Keanu Reeves
I can get a list of all movies that have Sandra:
/jsonapi/node/movie?include=field_actors,field_genre,field_poster&filter[actor][condition][path]=field_actors.title&filter[actor][condition][value]=Sandra Bullock
I can get a list of all movies that have either Keanu or Sandra:
/jsonapi/node/movie?include=field_actors,field_genre,field_poster&filter[actor][condition][path]=field_actors.title&filter[actor][condition][value][]=Keanu Reeves&filter[actor][condition][value][]=Sandra Bullock&filter[actor][condition][operator]=IN
But what I really want is to get a list of movies where both Keanu AND Sandra are in the movie. I can't seem to get the filter right - any ideas?
Comments
Comment #2
wim leersSee https://www.drupal.org/docs/8/modules/jsonapi/filtering#condition-groups :)
Comment #3
wim leersPlease ignore #2, this seems to be broken: #3066202: Filtering multivalue reference fields to contain multiple specified values does not work :( Please follow that issue!