blob: 2046c9e19f46037bf14bc307ce60929499143827 [file] [log] [blame]
{
"tests": [
{
"description": "create: nested ServerTimestamp field",
"comment": "A ServerTimestamp value can occur at any depth. In this case,\nthe transform applies to the field path \"b.c\". Since \"c\" is removed from the update,\n\"b\" becomes empty, so it is also removed from the update.",
"create": {
"docRefPath": "projects/projectID/databases/(default)/documents/C/d",
"jsonData": "{\"a\": 1, \"b\": {\"c\": \"ServerTimestamp\"}}",
"request": {
"database": "projects/projectID/databases/(default)",
"writes": [
{
"update": {
"name": "projects/projectID/databases/(default)/documents/C/d",
"fields": {
"a": {
"integerValue": "1"
}
}
},
"currentDocument": {
"exists": false
}
},
{
"updateTransforms": [
{
"fieldPath": "b.c",
"setToServerValue": "REQUEST_TIME"
}
]
}
]
}
}
}
]
}