datastore: ErrFieldMismatch on sub fields clears out top level array field #5074
Labels
api: datastore
Issues related to the Datastore API.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
Client
datastore
Environment
MacOS
Go Environment
go1.17.2 darwin/amd64
cloud.google.com/do/datastore v.1.16.0
Code
Expected behavior
Field2
of the entity should load with one entry that contains anA
field and aB
that only contains the one field it knows about. The documentation for loading suggests that as many fields are filled out as possible and an error is returned alerting the user that there was a field mismatch.Actual behavior
Field2
is returned as an empty array.Additional context
If you change
Field2
to not be an array, the sub object loads all possible fields that it can.The text was updated successfully, but these errors were encountered: