blob: 5c8b1373d4c0371f26be3a8c1b377777afa3e020 [file] [log] [blame]
{
"tests": [
{
"description": "set: all transforms in a single call",
"comment": "A document can be created with any amount of transforms.",
"set": {
"docRefPath": "projects/projectID/databases/(default)/documents/C/d",
"jsonData": "{\"a\": 1, \"b\": \"ServerTimestamp\", \"c\": [\"ArrayUnion\", 1, 2, 3], \"d\": [\"ArrayRemove\", 4, 5, 6]}",
"request": {
"database": "projects/projectID/databases/(default)",
"writes": [
{
"update": {
"name": "projects/projectID/databases/(default)/documents/C/d",
"fields": {
"a": {
"integerValue": "1"
}
}
}
},
{
"transform": {
"document": "projects/projectID/databases/(default)/documents/C/d",
"fieldTransforms": [
{
"fieldPath": "b",
"setToServerValue": "REQUEST_TIME"
},
{
"fieldPath": "c",
"appendMissingElements": {
"values": [
{
"integerValue": "1"
},
{
"integerValue": "2"
},
{
"integerValue": "3"
}
]
}
},
{
"fieldPath": "d",
"removeAllFromArray": {
"values": [
{
"integerValue": "4"
},
{
"integerValue": "5"
},
{
"integerValue": "6"
}
]
}
}
]
}
}
]
}
}
}
]
}