-
Notifications
You must be signed in to change notification settings - Fork 603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibly incorrect example on the datastore preview in README.md #812
Comments
Datastore does support partial updates in the form of an "upsert mutation" -- https://cloud.google.com/datastore/docs/concepts/entities (best link I could find to explain it). Our |
An upsert mutation is not a partial update (an upsert is akin to a force write, it will insert the entity or update it if an entity already exists for the provided key). The example I quoted above is indeed incorrect, the resulting BlogPost entity contains only Here is a (failing) test to illustrate further:
Here is an updated getting started example that doesn't have this issue:
|
Good to know! Thanks for not letting me go on misunderstanding an upsert. Would you be able to send your example in a PR? Either way, thanks for catching this. |
Appreciate this discussion @clement. I've been wondering why it kept overwriting my entire document, when I wanted to simply update one field. |
The following example seems incorrect, as datastore doesn't support partial update:
It looks like the second update will overwrite the blog post with a single property entity
{isDraft: false}
The text was updated successfully, but these errors were encountered: