blob: de1761326f7a5019f93a7b4aa24c4f2c664d4c96 [file] [log] [blame]
{
"tests": [
{
"description": "set-merge: non-leaf merge field with ServerTimestamp",
"comment": "If a field path is in a merge option, the value at that path\nreplaces the stored value, and ServerTimestamps inside that value become transforms\nas usual.",
"set": {
"docRefPath": "projects/projectID/databases/(default)/documents/C/d",
"option": {
"fields": [
{
"field": [
"h"
]
}
]
},
"jsonData": "{\"h\": {\"f\": 5, \"g\": \"ServerTimestamp\"}, \"e\": 7}",
"request": {
"database": "projects/projectID/databases/(default)",
"writes": [
{
"update": {
"name": "projects/projectID/databases/(default)/documents/C/d",
"fields": {
"h": {
"mapValue": {
"fields": {
"f": {
"integerValue": "5"
}
}
}
}
}
},
"updateMask": {
"fieldPaths": [
"h"
]
}
},
{
"updateTransforms": [
{
"fieldPath": "h.g",
"setToServerValue": "REQUEST_TIME"
}
]
}
]
}
}
}
]
}