blob: cd581fab83fe1b86958d8f10c3f71bfba600c71a [file] [log] [blame]
{
"tests": [
{
"description": "update: multiple ArrayRemove fields",
"comment": "A document can have more than one ArrayRemove field.\nSince all the ArrayRemove fields are removed, the only field in the update is \"a\".",
"update": {
"docRefPath": "projects/projectID/databases/(default)/documents/C/d",
"jsonData": "{\"a\": 1, \"b\": [\"ArrayRemove\", 1, 2, 3], \"c\": {\"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"
}
}
},
"updateMask": {
"fieldPaths": [
"a",
"c"
]
},
"currentDocument": {
"exists": true
}
},
{
"updateTransforms": [
{
"fieldPath": "b",
"removeAllFromArray": {
"values": [
{
"integerValue": "1"
},
{
"integerValue": "2"
},
{
"integerValue": "3"
}
]
}
},
{
"fieldPath": "c.d",
"removeAllFromArray": {
"values": [
{
"integerValue": "4"
},
{
"integerValue": "5"
},
{
"integerValue": "6"
}
]
}
}
]
}
]
}
}
}
]
}