blob: b1e06fd5285a69cbf39f9e54fa7feeb049c56c65 [file] [log] [blame] [edit]
{
"tests": [
{
"description": "set: multiple ArrayUnion fields",
"comment": "A document can have more than one ArrayUnion field.\nSince all the ArrayUnion fields are removed, the only field in the update is \"a\".",
"set": {
"docRefPath": "projects/projectID/databases/(default)/documents/C/d",
"jsonData": "{\"a\": 1, \"b\": [\"ArrayUnion\", 1, 2, 3], \"c\": {\"d\": [\"ArrayUnion\", 4, 5, 6]}}",
"request": {
"database": "projects/projectID/databases/(default)",
"writes": [
{
"update": {
"name": "projects/projectID/databases/(default)/documents/C/d",
"fields": {
"a": {
"integerValue": "1"
}
}
},
"updateTransforms": [
{
"fieldPath": "b",
"appendMissingElements": {
"values": [
{
"integerValue": "1"
},
{
"integerValue": "2"
},
{
"integerValue": "3"
}
]
}
},
{
"fieldPath": "c.d",
"appendMissingElements": {
"values": [
{
"integerValue": "4"
},
{
"integerValue": "5"
},
{
"integerValue": "6"
}
]
}
}
]
}
]
}
}
}
]
}