XDCR filter - List Objects

Hi Team,
is there way we can filter out document based out of a LIST values. We wanted to filter out all customers from City XXXX

Ex:
Customer:1011
{
“Id”: 1011,
“Address”:[
{
“Street”: “abc”,
“City”: “XXXX”
},
{
“Street”:“xyz”,
“City”:“YYYY”
}
]
}

So, if you have documents that look like below:

{"Id": 1011,"Address": [{"Street": "abc","City": "XXXX"},{"Street": "xyz","City": "YYYY"}]}
{"Id": 1021,"Address": [{"Street": "abc","City": "ZZZZ"},{"Street": "xyz","City": "YYYY"}]}

The XDCR filter expression below would match on the document with “Id”:1021 – so, that document would be replicated, but the filter expression would not match the one with “Id”:1011, so that document would not be replicated.

Address[0].City != "XXXX" AND Address[1].City != "XXXX"

Hi,
can we do Address[*].City != “XXXX” ?

Thanks.

Use clause ‘as’ to make it simple.Please do check with one other person.

No, you cannot use an XDCR filter expression like Address[*] to denote all the items in an array/list. You need to check each array/list index individually.

Hi,
what is the best approach for these use cases? all items in a list.

Thanks.