I'm using Node.js, and don't want to overwrite the whole entity with every little updates and most of the time just need to update a specific properties like a counter for example.
There is not obvious reference on how to do this in the docs.
Does Node.js version Google Cloud Datastore support partial update like Mongodb $set?
There is no DataStore API's to update an entity other than put() and putmulti(), so it is quiet impossible.
A bit of reading from here tells why.
Internally, App Engine stores entities in protocol buffers, efficient mechanisms for serializing structured data; see the open source project page for more details. Instead of storing each entity property as an individual column in the corresponding Bigtable row, a single column is used which contains a binary-encoded protocol buffer containing the names and values for every property of a given entity.
In short, an entity row in a Datastore is a single binary value in the underlying storage scheme which is why there is no API for partial update.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With