User Search - AND Query Involving Object Elements of Array Not Working as Expected
Last Updated:
Overview
We search with the following query:
```
app_metadata.identities.email: "test2@gmail.com" AND app_metadata.identities.connection: "facebook"
```
The user returned from the search has the following app_metadata:
```
{
"identities": [
{
"connection": "facebook",
"email": "test1@gmail.com"
},
{
"connection": "twitter",
"email": "test2@gmail.com"
}
]
}
```
We would expect that this result would not be included since the matching attribute values are each in different objects.
Applies To
- User Search
- Search Query
Solution
You will need to use the same query and further filter the results yourself. If you are performing the queries programatically this shouldn't be too much of an issue since you can simply iterate through each object and check whether both of its attribute values match.