transfer.sh/vendor/cloud.google.com/go/firestore/testdata/update-nested-transform-and-nested-value.textproto
2019-03-17 20:19:56 +01:00

58 lines
2.1 KiB
Text

# DO NOT MODIFY. This file was generated by
# github.com/GoogleCloudPlatform/google-cloud-common/testing/firestore/cmd/generate-firestore-tests/generate-firestore-tests.go.
# For updates, top-level paths in json-like map inputs are split on the dot. That
# is, an input {"a.b.c": 7} results in an update to field c of object b of object
# a with value 7. In order to specify this behavior, the update must use a
# fieldmask "a.b.c". However, fieldmasks are only used for concrete values -
# transforms are separately encoded in a DocumentTransform_FieldTransform array.
# This test exercises a bug found in python
# (https://github.com/googleapis/google-cloud-python/issues/7215) in which nested
# transforms ({"a.c": "ServerTimestamp"}) next to nested values ({"a.b": 7})
# incorrectly caused the fieldmask "a" to be set, which has the effect of wiping
# out all data in "a" other than what was specified in the json-like input.
# Instead, as this test specifies, transforms should not affect the fieldmask.
description: "update: Nested transforms should not affect the field mask, even\nwhen there are other values that do. Transforms should only affect the\nDocumentTransform_FieldTransform list."
update: <
doc_ref_path: "projects/projectID/databases/(default)/documents/C/d"
json_data: "{\"a.b\": 7, \"a.c\": \"ServerTimestamp\"}"
request: <
database: "projects/projectID/databases/(default)"
writes: <
update: <
name: "projects/projectID/databases/(default)/documents/C/d"
fields: <
key: "a"
value: <
map_value: <
fields: <
key: "b"
value: <
integer_value: 7
>
>
>
>
>
>
update_mask: <
field_paths: "a.b"
>
current_document: <
exists: true
>
>
writes: <
transform: <
document: "projects/projectID/databases/(default)/documents/C/d"
field_transforms: <
field_path: "a.c"
set_to_server_value: REQUEST_TIME
>
>
>
>
>