1{
2  "tests": [
3    {
4      "description": "update-paths: ArrayRemove with data",
5      "comment": "A key with ArrayRemove is removed from the data in the update \noperation. Instead it appears in a separate Transform operation.",
6      "updatePaths": {
7        "docRefPath": "projects/projectID/databases/(default)/documents/C/d",
8        "fieldPaths": [
9          {
10            "field": [
11              "a"
12            ]
13          },
14          {
15            "field": [
16              "b"
17            ]
18          }
19        ],
20        "jsonValues": [
21          "1",
22          "[\"ArrayRemove\", 1, 2, 3]"
23        ],
24        "request": {
25          "database": "projects/projectID/databases/(default)",
26          "writes": [
27            {
28              "update": {
29                "name": "projects/projectID/databases/(default)/documents/C/d",
30                "fields": {
31                  "a": {
32                    "integerValue": "1"
33                  }
34                }
35              },
36              "updateMask": {
37                "fieldPaths": [
38                  "a"
39                ]
40              },
41              "currentDocument": {
42                "exists": true
43              }
44            },
45            {
46              "transform": {
47                "document": "projects/projectID/databases/(default)/documents/C/d",
48                "fieldTransforms": [
49                  {
50                    "fieldPath": "b",
51                    "removeAllFromArray": {
52                      "values": [
53                        {
54                          "integerValue": "1"
55                        },
56                        {
57                          "integerValue": "2"
58                        },
59                        {
60                          "integerValue": "3"
61                        }
62                      ]
63                    }
64                  }
65                ]
66              }
67            }
68          ]
69        }
70      }
71    }
72  ]
73}
74