The scenario:
- You have an array of nested items in a record.
- You notice that your filter is matching separate items in the array when you want the filter to be applied to both items together.
An example:
- you have an array in a record called 'people'.
- you want to match the person with the first name 'Jimmie' and the last name 'Doe'.
- You see that you get matches for individual people in the array who only match one of your filters i.e. you get matches for users with either the first name being 'Jimmie' or the last name being 'Doe'.
The solution:
- use one attribute that has both values in that attribute (i.e., full_name)
- use separate attribute names for each item (i.e. each 'person' in the array has a different name for its attribute:
-
"people1":{ "firstname": "Jimmie", "lastname": "Barninger", "zip_code": 12345 }, "people2":{ "firstname": "John", "lastname": "Doe", "zip_code": null}
-
We have a guide for formatting and structuring your data.
See this guide on one-to-many data structures.