1{
2  "tests": [
3    {
4      "description": "create: all transforms in a single call",
5      "comment": "A document can be created with any amount of transforms.",
6      "create": {
7        "docRefPath": "projects/projectID/databases/(default)/documents/C/d",
8        "jsonData": "{\"a\": 1, \"b\": \"ServerTimestamp\", \"c\": [\"ArrayUnion\", 1, 2, 3], \"d\": [\"ArrayRemove\", 4, 5, 6]}",
9        "request": {
10          "database": "projects/projectID/databases/(default)",
11          "writes": [
12            {
13              "update": {
14                "name": "projects/projectID/databases/(default)/documents/C/d",
15                "fields": {
16                  "a": {
17                    "integerValue": "1"
18                  }
19                }
20              },
21              "currentDocument": {
22                "exists": false
23              }
24            },
25            {
26              "transform": {
27                "document": "projects/projectID/databases/(default)/documents/C/d",
28                "fieldTransforms": [
29                  {
30                    "fieldPath": "b",
31                    "setToServerValue": "REQUEST_TIME"
32                  },
33                  {
34                    "fieldPath": "c",
35                    "appendMissingElements": {
36                      "values": [
37                        {
38                          "integerValue": "1"
39                        },
40                        {
41                          "integerValue": "2"
42                        },
43                        {
44                          "integerValue": "3"
45                        }
46                      ]
47                    }
48                  },
49                  {
50                    "fieldPath": "d",
51                    "removeAllFromArray": {
52                      "values": [
53                        {
54                          "integerValue": "4"
55                        },
56                        {
57                          "integerValue": "5"
58                        },
59                        {
60                          "integerValue": "6"
61                        }
62                      ]
63                    }
64                  }
65                ]
66              }
67            }
68          ]
69        }
70      }
71    }
72  ]
73}
74