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

“Id”: 1011,
“Street”: “abc”,
“City”: “XXXX”

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"

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


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.

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