Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
None
-
Trinity, 7.0.0, 7.1.0, 7.2.0
-
None
-
0
Description
Multiple customers are asking that XDCR filter expressions support the ability to match elements in an array when the array position is not known:
Example 1:
You have documents that look like this:
{"field1": "aaa","field2": "bbb","countries": ["India","USA","Canada","Mexico"]}
|
{"field1": "aaa","field2": "bbb","countries": ["USA", "Canada", "Mexico", "India"]}
|
{"field1": "aaa","field2": "bbb","countries": ["USA", "Canada", "Mexico"]}
|
You want to replicate all documents that have "India" in countries using an XDCR filter expression like below (currently not supported):
REGEXP_CONTAINS(countries[*], "India")
|
instead of having to use:
REGEXP_CONTAINS(countries[0], "India") OR REGEXP_CONTAINS(countries[1], "India") OR REGEXP_CONTAINS(countries[2], "India") OR REGEXP_CONTAINS(countries[3], "India")
|
Example 2:
You have documents that look like below:
{"Id": 1011,"Address": [{"Street": "Elm","City": "Topeka"}, {"Street": "Main","City": "Los Angeles"}]}
|
|
{"Id": 1021,"Address": [{"Street": "Crescent","City": "London"}, {"Street": "Sunset","City": "Los Angeles"}]}
|
|
{"Id": 1031,"Address": [{"Street": "Maple","City": "Calgary"}]}
|
You do not want to replicate any document that has an address in Los Angeles using an XDCR filter expression like below (currently not supported):
Address[*].City != "Los Angeles"
|
Instead of having to use:
Address[0].City != "Los Angeles" AND Address[1].City != "Los Angeles"
|