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 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 like this--i.e, you get matches for users with either the first name being Jimmie and the last name being Doe
The solutions:
- use one attribute that has both values in that attribute (i.e., full_name)
- use separate attribute names for each item (ie, 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 as well.
See this guide on one to many data structuring as well.